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/styles/widgetgallery.cpp | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'examples/widgets/widgets/styles/widgetgallery.cpp') diff --git a/examples/widgets/widgets/styles/widgetgallery.cpp b/examples/widgets/widgets/styles/widgetgallery.cpp index d44547d905..dbe82c547b 100644 --- a/examples/widgets/widgets/styles/widgetgallery.cpp +++ b/examples/widgets/widgets/styles/widgetgallery.cpp @@ -79,19 +79,19 @@ WidgetGallery::WidgetGallery(QWidget *parent) //! [0] //! [1] - connect(styleComboBox, SIGNAL(activated(QString)), + connect(styleComboBox, QOverload::of(&QComboBox::activated), //! [1] //! [2] - this, SLOT(changeStyle(QString))); - connect(useStylePaletteCheckBox, SIGNAL(toggled(bool)), - this, SLOT(changePalette())); - connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), - topLeftGroupBox, SLOT(setDisabled(bool))); - connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), - topRightGroupBox, SLOT(setDisabled(bool))); - connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), - bottomLeftTabWidget, SLOT(setDisabled(bool))); - connect(disableWidgetsCheckBox, SIGNAL(toggled(bool)), - bottomRightGroupBox, SLOT(setDisabled(bool))); + this, &WidgetGallery::changeStyle); + connect(useStylePaletteCheckBox, &QCheckBox::toggled, + this, &WidgetGallery::changePalette); + connect(disableWidgetsCheckBox, &QCheckBox::toggled, + topLeftGroupBox, &QGroupBox::setDisabled); + connect(disableWidgetsCheckBox, &QCheckBox::toggled, + topRightGroupBox, &QGroupBox::setDisabled); + connect(disableWidgetsCheckBox, &QCheckBox::toggled, + bottomLeftTabWidget, &QGroupBox::setDisabled); + connect(disableWidgetsCheckBox, &QCheckBox::toggled, + bottomRightGroupBox, &QGroupBox::setDisabled); //! [2] //! [3] @@ -279,7 +279,7 @@ void WidgetGallery::createProgressBar() progressBar->setValue(0); QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(advanceProgressBar())); + connect(timer, &QTimer::timeout, this, &WidgetGallery::advanceProgressBar); timer->start(1000); } //! [13] -- cgit v1.2.3