Changeset 79957 in vbox
- Timestamp:
- Jul 24, 2019 1:42:49 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132388
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialogContainer.cpp
r79900 r79957 18 18 /* Qt includes: */ 19 19 #include <QGridLayout> 20 #include <QPushButton> 20 21 21 22 /* GUI includes: */ … … 27 28 , m_pLayout(0) 28 29 , m_pWidget(0) 30 , m_pButtonBox(0) 29 31 { 30 32 prepare(); … … 39 41 } 40 42 43 void QIDialogContainer::setOkButtonEnabled(bool fEnabled) 44 { 45 m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(fEnabled); 46 } 47 41 48 void QIDialogContainer::prepare() 42 49 { … … 46 53 { 47 54 /* Prepare dialog button-box: */ 48 QIDialogButtonBox *pButtonBox = new QIDialogButtonBox(this);49 if ( pButtonBox)55 m_pButtonBox = new QIDialogButtonBox(this); 56 if (m_pButtonBox) 50 57 { 51 pButtonBox->setStandardButtons(QDialogButtonBox::Ok);52 connect( pButtonBox, &QIDialogButtonBox::accepted,58 m_pButtonBox->setStandardButtons(QDialogButtonBox::Ok); 59 connect(m_pButtonBox, &QIDialogButtonBox::accepted, 53 60 this, &QDialog::accept); 54 connect( pButtonBox, &QIDialogButtonBox::rejected,61 connect(m_pButtonBox, &QIDialogButtonBox::rejected, 55 62 this, &QDialog::reject); 56 63 57 m_pLayout->addWidget( pButtonBox, 1, 0);64 m_pLayout->addWidget(m_pButtonBox, 1, 0); 58 65 } 59 66 } -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialogContainer.h
r79939 r79957 31 31 class QGridLayout; 32 32 class QWidget; 33 class QIDialogButtonBox; 33 34 34 35 /** QDialog sub-class used as executable input container for passed widget. … … 51 52 void sltActivateWindow() { activateWindow(); } 52 53 54 /** Sets Ok button to be @a fEnabled. */ 55 void setOkButtonEnabled(bool fEnabled); 56 53 57 private: 54 58 … … 57 61 58 62 /** Holds the layout instance. */ 59 QGridLayout *m_pLayout;63 QGridLayout *m_pLayout; 60 64 /** Holds the widget reference. */ 61 QWidget *m_pWidget; 65 QWidget *m_pWidget; 66 /** Holds the button-box instance. */ 67 QIDialogButtonBox *m_pButtonBox; 62 68 }; 63 69
Note:
See TracChangeset
for help on using the changeset viewer.