diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-07-03 13:43:30 +0200 |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-07-03 13:43:30 +0200 |
commit | 3668bfcb981146e0f3b3f6d4ad73d66cde2ad2fd (patch) | |
tree | 69541e03ad176bca45eca8c5962c86f10c8ff5ba | |
parent | bf4ff76ad2036603a702cee9ecdb57172d520e4b (diff) |
Add an extra button for disabling the whole controller.
-rw-r--r-- | example/simple/main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/example/simple/main.cpp b/example/simple/main.cpp index ea9fc86..928cc09 100644 --- a/example/simple/main.cpp +++ b/example/simple/main.cpp @@ -31,10 +31,17 @@ public: button->setChecked(false); connect(button, SIGNAL(toggled(bool)), SLOT(updateBart(bool))); + QVBoxLayout *vboxlayout = new QVBoxLayout(); vboxlayout->addWidget(controller); vboxlayout->addWidget(segmentControl); vboxlayout->addWidget(button); + + button = new QCheckBox(tr("Disable the whole thing")); + button->setChecked(false); + connect(button, SIGNAL(toggled(bool)), SLOT(updateDisabledController(bool))); + + vboxlayout->addWidget(button); setLayout(vboxlayout); } @@ -47,6 +54,11 @@ private slots: segmentControl->setSegmentEnabled(2, !enabled); } + void updateDisabledController(bool disabled) + { + segmentControl->setDisabled(disabled); + } + private: QtSegmentControl *controller; QtSegmentControl *segmentControl; |