- Timestamp:
- Oct 6, 2016 12:29:30 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStyledItemDelegate.h
r64161 r64162 38 38 QIStyledItemDelegate(QObject *pParent) 39 39 : QStyledItemDelegate(pParent) 40 , m_fWatchForEditorDataCommits(false) 40 41 , m_fWatchForEditorEnterKeyTriggering(false) 41 42 {} 42 43 44 /** Defines whether delegate should watch for the editor's data commits. */ 45 void setWatchForEditorDataCommits(bool fWatch) { m_fWatchForEditorDataCommits = fWatch; } 43 46 /** Defines whether delegate should watch for the editor's Enter key triggering. */ 44 47 void setWatchForEditorEnterKeyTriggering(bool fWatch) { m_fWatchForEditorEnterKeyTriggering = fWatch; } 45 48 46 pr ivate:49 protected: 47 50 48 51 /** Returns the widget used to edit the item specified by @a index. 49 52 * The @a pParent widget and style @a option are used to control how the editor widget appears. */ 50 QWidget* createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const53 virtual QWidget *createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const /* override */ 51 54 { 52 55 /* Call to base-class to get actual editor created: */ 53 56 QWidget *pEditor = QStyledItemDelegate::createEditor(pParent, option, index); 54 57 55 connect(pEditor, SIGNAL(sigCommitData(QWidget*)), this, SIGNAL(commitData(QWidget*))); 58 /* Watch for editor data commits, redirect to listeners: */ 59 if (m_fWatchForEditorDataCommits) 60 connect(pEditor, SIGNAL(sigCommitData(QWidget *)), this, SIGNAL(commitData(QWidget *))); 56 61 57 62 /* Watch for editor Enter key triggering, redirect to listeners: */ … … 63 68 } 64 69 70 private: 71 72 /** Holds whether delegate should watch for the editor's data commits. */ 73 bool m_fWatchForEditorDataCommits : 1; 65 74 /** Holds whether delegate should watch for the editor's Enter key triggering. */ 66 bool m_fWatchForEditorEnterKeyTriggering ;75 bool m_fWatchForEditorEnterKeyTriggering : 1; 67 76 }; 68 77 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.cpp
r62493 r64162 408 408 setItemDelegate(pStyledItemDelegate); 409 409 /* Configure item delegate: */ 410 pStyledItemDelegate->setWatchForEditorDataCommits(true); 410 411 pStyledItemDelegate->setWatchForEditorEnterKeyTriggering(true); 411 412 connect(pStyledItemDelegate, SIGNAL(sigEditorEnterKeyTriggered()), -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
r62493 r64162 603 603 /* Set configured item editor factory for table delegate: */ 604 604 pStyledItemDelegate->setItemEditorFactory(pNewItemEditorFactory); 605 606 /* Configure item delegate: */ 607 pStyledItemDelegate->setWatchForEditorDataCommits(true); 605 608 } 606 609
Note:
See TracChangeset
for help on using the changeset viewer.