- Timestamp:
- Oct 6, 2016 1:59:29 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r64067 r64163 539 539 src/extensions/QISplitter.cpp \ 540 540 src/extensions/QIAdvancedToolBar.cpp \ 541 src/extensions/QITableView.cpp \542 541 src/extradata/UIExtraDataManager.cpp \ 543 542 src/globals/UIActionPool.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStyledItemDelegate.h
r64162 r64163 29 29 30 30 signals: 31 32 /** Notifies listeners about @a pEditor created for particular model @a index. */ 33 void sigEditorCreated(QWidget *pEditor, const QModelIndex &index) const; 31 34 32 35 /** Notifies listeners about editor's Enter key triggering. */ … … 64 67 connect(pEditor, SIGNAL(sigEnterKeyTriggered()), this, SIGNAL(sigEditorEnterKeyTriggered())); 65 68 69 /* Notify listeners about editor created: */ 70 emit sigEditorCreated(pEditor, index); 71 66 72 /* Return actual editor: */ 67 73 return pEditor; -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.cpp
r60496 r64163 20 20 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 21 21 22 /* Qt includes: */23 # include <QStyledItemDelegate>24 25 22 /* GUI includes: */ 26 23 # include "QITableView.h" 24 # include "QIStyledItemDelegate.h" 27 25 28 26 /* Other VBox includes: */ … … 31 29 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 32 30 33 34 /** QStyledItemDelegate extension used with QITableView. */35 class QITableViewStyledItemDelegate : public QStyledItemDelegate36 {37 Q_OBJECT;38 39 signals:40 41 /** Notifies listeners about @a pEditor created for particular model @a index. */42 void sigEditorCreated(QWidget *pEditor, const QModelIndex &index) const;43 44 public:45 46 /** Constructs table-view styled-item-delegate on the basis of passed @a pParent. */47 QITableViewStyledItemDelegate(QObject *pParent);48 49 private:50 51 /** Returns the widget used to edit the item specified by @a index for editing.52 * The @a pParent widget and style @a option are used to control how the editor widget appears.53 * Besides that, we are notifying listener about editor was created for particular model @a index. */54 virtual QWidget* createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const;55 };56 57 58 /*********************************************************************************************************************************59 * Class QITableViewStyledItemDelegate implementation. *60 *********************************************************************************************************************************/61 62 QITableViewStyledItemDelegate::QITableViewStyledItemDelegate(QObject *pParent)63 : QStyledItemDelegate(pParent)64 {65 }66 67 QWidget* QITableViewStyledItemDelegate::createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const68 {69 /* Call to base-class: */70 QWidget *pEditor = QStyledItemDelegate::createEditor(pParent, option, index);71 /* Notify listeners about editor created: */72 emit sigEditorCreated(pEditor, index);73 /* Return editor: */74 return pEditor;75 }76 77 78 /*********************************************************************************************************************************79 * Class QITableView implementation. *80 *********************************************************************************************************************************/81 31 82 32 QITableView::QITableView(QWidget *pParent) … … 109 59 delete itemDelegate(); 110 60 /* Create new delegate: */ 111 QI TableViewStyledItemDelegate *pStyledItemDelegate = new QITableViewStyledItemDelegate(this);61 QIStyledItemDelegate *pStyledItemDelegate = new QIStyledItemDelegate(this); 112 62 AssertPtrReturnVoid(pStyledItemDelegate); 113 63 { … … 143 93 } 144 94 145 #include "QITableView.moc"146
Note:
See TracChangeset
for help on using the changeset viewer.