From 1a5b3356e5c07d4be19662fac1653ae98cddbbaa Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Fri, 30 Sep 2011 09:56:46 +0200 Subject: Add another part of the source code to the snippet. Fixes: QTBUG-21765 --- examples/dialogs/extension/finddialog.cpp | 2 ++ src/gui/widgets/qdialogbuttonbox.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/examples/dialogs/extension/finddialog.cpp b/examples/dialogs/extension/finddialog.cpp index 2ce0391..2457a5b 100644 --- a/examples/dialogs/extension/finddialog.cpp +++ b/examples/dialogs/extension/finddialog.cpp @@ -104,9 +104,11 @@ FindDialog::FindDialog(QWidget *parent) connect(backSoftKeyAction, SIGNAL(triggered()), qApp, SLOT(quit())); addAction(backSoftKeyAction); #else +//! [6] buttonBox = new QDialogButtonBox(Qt::Vertical); buttonBox->addButton(findButton, QDialogButtonBox::ActionRole); buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole); +//! [6] connect(moreButton, SIGNAL(toggled(bool)), extension, SLOT(setVisible(bool))); #endif diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 6c29141..e6842b3 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -94,6 +94,7 @@ QT_BEGIN_NAMESPACE specifying their role. \snippet examples/dialogs/extension/finddialog.cpp 1 + \snippet examples/dialogs/extension/finddialog.cpp 6 Alternatively, QDialogButtonBox provides several standard buttons (e.g. OK, Cancel, Save) that you can use. They exist as flags so you can OR them together in the constructor. -- cgit v0.12