Changeset 79720 in vbox
- Timestamp:
- Jul 12, 2019 8:10:01 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFormEditorWidget.cpp
r79365 r79720 25 25 #include <QSortFilterProxyModel> 26 26 #include <QSpinBox> 27 #include <QStyledItemDelegate>28 27 #include <QTextEdit> 29 28 #include <QVBoxLayout> … … 32 31 #include "QIDialog.h" 33 32 #include "QIDialogButtonBox.h" 33 #include "QIStyledItemDelegate.h" 34 34 #include "QITableView.h" 35 35 #include "QIWithRetranslateUI.h" … … 202 202 Q_PROPERTY(TextData text READ text WRITE setText USER true); 203 203 204 signals: 205 206 /** Notifies listener about data should be committed. */ 207 void sigCommitData(QWidget *pThis); 208 204 209 public: 205 210 … … 242 247 Q_PROPERTY(ChoiceData choice READ choice WRITE setChoice USER true); 243 248 249 signals: 250 251 /** Notifies listener about data should be committed. */ 252 void sigCommitData(QWidget *pThis); 253 244 254 public: 245 255 246 256 /** Constructs ChoiceData editor passing @a pParent to the base-class. */ 247 257 ChoiceEditor(QWidget *pParent = 0); 258 259 private slots: 260 261 /** Handles current index change. */ 262 void sltCurrentIndexChanged(); 248 263 249 264 private: … … 261 276 Q_OBJECT; 262 277 Q_PROPERTY(RangedIntegerData rangedInteger READ rangedInteger WRITE setRangedInteger USER true); 278 279 signals: 280 281 /** Notifies listener about data should be committed. */ 282 void sigCommitData(QWidget *pThis); 263 283 264 284 public: … … 584 604 : QComboBox(pParent) 585 605 { 606 connect(this, static_cast<void(ChoiceEditor::*)(int)>(&ChoiceEditor::currentIndexChanged), 607 this, &ChoiceEditor::sltCurrentIndexChanged); 608 } 609 610 void ChoiceEditor::sltCurrentIndexChanged() 611 { 612 emit sigCommitData(this); 586 613 } 587 614 588 615 void ChoiceEditor::setChoice(const ChoiceData &choice) 589 616 { 617 clear(); 590 618 addItems(choice.values().toList()); 591 619 setCurrentIndex(choice.selectedIndex()); … … 1437 1465 { 1438 1466 /* But is this also styled item delegate? */ 1439 Q StyledItemDelegate *pStyledItemDelegate = qobject_cast<QStyledItemDelegate*>(pAbstractItemDelegate);1467 QIStyledItemDelegate *pStyledItemDelegate = qobject_cast<QIStyledItemDelegate*>(pAbstractItemDelegate); 1440 1468 if (pStyledItemDelegate) 1441 1469 { 1470 /* Configure item delegate: */ 1471 pStyledItemDelegate->setWatchForEditorDataCommits(true); 1472 1442 1473 /* Create new item editor factory: */ 1443 1474 QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;
Note:
See TracChangeset
for help on using the changeset viewer.

