diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-12-02 14:16:47 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-26 10:37:06 +0000 |
commit | bf4bf3a58360d4f7907895096b452cb3821ea593 (patch) | |
tree | 0a784f40986afb9c73aed2f5d13a2f554a09ce2e /examples/widgets/widgets/windowflags/controllerwindow.cpp | |
parent | e81acde7d0cf5fb44a3fb2cf0bf7aaa2c65f807e (diff) |
Cleanup Widgets examples - signals/slots
Cleanup the widgets examples - use new signal/slot syntax where possible
Change-Id: I6bc8953534d8b1efca0de4ee6a9fe4a6aa79fda9
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/widgets/widgets/windowflags/controllerwindow.cpp')
-rw-r--r-- | examples/widgets/widgets/windowflags/controllerwindow.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/widgets/widgets/windowflags/controllerwindow.cpp b/examples/widgets/widgets/windowflags/controllerwindow.cpp index c19f23c513..e2abad89f4 100644 --- a/examples/widgets/widgets/windowflags/controllerwindow.cpp +++ b/examples/widgets/widgets/windowflags/controllerwindow.cpp @@ -62,7 +62,8 @@ ControllerWindow::ControllerWindow(QWidget *parent) createHintsGroupBox(); quitButton = new QPushButton(tr("&Quit")); - connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); + connect(quitButton, &QPushButton::clicked, + qApp, &QApplication::quit); QHBoxLayout *bottomLayout = new QHBoxLayout; bottomLayout->addStretch(); @@ -220,7 +221,8 @@ void ControllerWindow::createHintsGroupBox() QCheckBox *ControllerWindow::createCheckBox(const QString &text) { QCheckBox *checkBox = new QCheckBox(text); - connect(checkBox, SIGNAL(clicked()), this, SLOT(updatePreview())); + connect(checkBox, &QCheckBox::clicked, + this, &ControllerWindow::updatePreview); return checkBox; } //! [7] @@ -229,7 +231,8 @@ QCheckBox *ControllerWindow::createCheckBox(const QString &text) QRadioButton *ControllerWindow::createRadioButton(const QString &text) { QRadioButton *button = new QRadioButton(text); - connect(button, SIGNAL(clicked()), this, SLOT(updatePreview())); + connect(button, &QRadioButton::clicked, + this, &ControllerWindow::updatePreview); return button; } //! [8] |