diff options
-rw-r--r-- | examples/widgets/tools/i18n/languagechooser.cpp | 9 | ||||
-rw-r--r-- | examples/widgets/tools/i18n/mainwindow.cpp | 2 |
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)); |