From bf4bf3a58360d4f7907895096b452cb3821ea593 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 2 Dec 2018 14:16:47 +0100 Subject: Cleanup Widgets examples - signals/slots Cleanup the widgets examples - use new signal/slot syntax where possible Change-Id: I6bc8953534d8b1efca0de4ee6a9fe4a6aa79fda9 Reviewed-by: Samuel Gaist Reviewed-by: Konstantin Shegunov Reviewed-by: Edward Welbourne Reviewed-by: Paul Wicking --- examples/widgets/widgets/windowflags/controllerwindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'examples/widgets/widgets/windowflags/controllerwindow.cpp') 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] -- cgit v1.2.3