summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorNico Vertriest <nico.vertriest@qt.io>2018-03-20 10:41:04 +0100
committerNico Vertriest <nico.vertriest@qt.io>2018-04-09 06:51:23 +0000
commit5ffd47b76418eb4ef3369a78471cd6567c4659d0 (patch)
tree92d6b1921beca6be7e3f526bf20aea8b00170bff /examples
parent5c240f380aa936a4f0a781c035fcd148cd4b3720 (diff)
Doc: Update connect syntax in I18n Widgets Example
Task-number: QTBUG-60635 Change-Id: Icfa0d09ac6c9ad4396fbe1138277bb1dd866a803 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/tools/i18n/languagechooser.cpp9
-rw-r--r--examples/widgets/tools/i18n/mainwindow.cpp2
2 files changed, 7 insertions, 4 deletions
diff --git a/examples/widgets/tools/i18n/languagechooser.cpp b/examples/widgets/tools/i18n/languagechooser.cpp
index 83aafe6b8a..58cf9d4047 100644
--- a/examples/widgets/tools/i18n/languagechooser.cpp
+++ b/examples/widgets/tools/i18n/languagechooser.cpp
@@ -70,7 +70,10 @@ LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent)
for (int i = 0; i < qmFiles.size(); ++i) {
QCheckBox *checkBox = new QCheckBox(languageName(qmFiles[i]));
qmFileForCheckBoxMap.insert(checkBox, qmFiles[i]);
- connect(checkBox, SIGNAL(toggled(bool)), this, SLOT(checkBoxToggled()));
+ connect(checkBox,
+ QOverload<bool>::of(&QCheckBox::toggled),
+ this,
+ &LanguageChooser::checkBoxToggled);
if (languageMatch(defaultLang, qmFiles[i]))
checkBox->setCheckState(Qt::Checked);
groupBoxLayout->addWidget(checkBox, i / 2, i % 2);
@@ -84,8 +87,8 @@ LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent)
hideAllButton = buttonBox->addButton("Hide All",
QDialogButtonBox::ActionRole);
- connect(showAllButton, SIGNAL(clicked()), this, SLOT(showAll()));
- connect(hideAllButton, SIGNAL(clicked()), this, SLOT(hideAll()));
+ connect(showAllButton, &QAbstractButton::clicked, this, &LanguageChooser::showAll);
+ connect(hideAllButton, &QAbstractButton::clicked, this, &LanguageChooser::hideAll);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(groupBox);
diff --git a/examples/widgets/tools/i18n/mainwindow.cpp b/examples/widgets/tools/i18n/mainwindow.cpp
index d5de81cab7..6ebfddfa98 100644
--- a/examples/widgets/tools/i18n/mainwindow.cpp
+++ b/examples/widgets/tools/i18n/mainwindow.cpp
@@ -76,7 +76,7 @@ MainWindow::MainWindow()
centralWidget->setLayout(mainLayout);
exitAction = new QAction(tr("E&xit"), this);
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+ connect(exitAction, &QAction::triggered, qApp, QApplication::quit);
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->setPalette(QPalette(Qt::red));