Changeset 64168 in vbox
- Timestamp:
- Oct 6, 2016 2:55:18 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111150
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.cpp
r64163 r64168 54 54 } 55 55 56 void QITableView::sltEditorCreated(QWidget *pEditor, const QModelIndex &index) 57 { 58 /* Connect created editor to the table and store it: */ 59 connect(pEditor, SIGNAL(destroyed(QObject *)), this, SLOT(sltEditorDestroyed(QObject *))); 60 m_editors[index] = pEditor; 61 } 62 63 void QITableView::sltEditorDestroyed(QObject *pEditor) 64 { 65 /* Clear destroyed editor from the table: */ 66 const QModelIndex index = m_editors.key(pEditor); 67 AssertReturnVoid(index.isValid()); 68 m_editors.remove(index); 69 } 70 56 71 void QITableView::prepare() 57 72 { … … 70 85 } 71 86 72 void QITableView::sltEditorCreated(QWidget *pEditor, const QModelIndex &index)73 {74 /* Connect created editor to the table and store it: */75 connect(pEditor, SIGNAL(destroyed(QObject *)), this, SLOT(sltEditorDestroyed(QObject *)));76 m_editors[index] = pEditor;77 }78 79 void QITableView::sltEditorDestroyed(QObject *pEditor)80 {81 /* Clear destroyed editor from the table: */82 QModelIndex index = m_editors.key(pEditor);83 AssertReturnVoid(index.isValid());84 m_editors.remove(index);85 }86 87 87 void QITableView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) 88 88 { -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.h
r60496 r64168 22 22 #include <QTableView> 23 23 24 /** QTableView extension providing GUI with advanced functionality. */ 24 25 /** QTableView subclass extending standard functionality. */ 25 26 class QITableView : public QTableView 26 27 { … … 34 35 public: 35 36 36 /** Constructs table-view on the basis of passed @a pParent. */37 /** Constructs table-view passing @a pParent to the base-class. */ 37 38 QITableView(QWidget *pParent = 0); 38 39 … … 40 41 void makeSureEditorDataCommitted(); 41 42 43 protected slots: 44 45 /** Stores the created @a pEditor for passed @a index in the map. */ 46 virtual void sltEditorCreated(QWidget *pEditor, const QModelIndex &index); 47 /** Clears the destoyed @a pEditor from the map. */ 48 virtual void sltEditorDestroyed(QObject *pEditor); 49 42 50 protected: 43 51 44 52 /** Prepares all. */ 45 v oid prepare();53 virtual void prepare(); 46 54 47 55 /** Handles index change from @a previous to @a current. */ 48 56 virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) /* override */; 49 50 protected slots:51 52 /** Stores the created @a pEditor for passed @a index in the map. */53 void sltEditorCreated(QWidget *pEditor, const QModelIndex &index);54 /** Clears the destoyed @a pEditor from the map. */55 void sltEditorDestroyed(QObject *pEditor);56 57 private:58 57 59 58 /** Holds the map of editors stored for passed indexes. */
Note:
See TracChangeset
for help on using the changeset viewer.