summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-09-28 13:01:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-28 13:01:47 (GMT)
commit071755c3ef0a010527b53376606749b697dae14e (patch)
tree17f1ea378fa3a563bc2b6ad86d960613e9217be5 /Source
parent20bd9c267435bbeb50f380c75653535c0c2620fd (diff)
parentab8f6fdd8c9da74c22cc9f7cf3011c58f9bebd39 (diff)
downloadCMake-071755c3ef0a010527b53376606749b697dae14e.zip
CMake-071755c3ef0a010527b53376606749b697dae14e.tar.gz
CMake-071755c3ef0a010527b53376606749b697dae14e.tar.bz2
Merge topic 'cmake-gui-slot-connections'
ab8f6fdd8c CMake GUI: Modernize signal-slot connections Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !5278
Diffstat (limited to 'Source')
-rw-r--r--Source/QtDialog/AddCacheEntry.cxx6
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx252
-rw-r--r--Source/QtDialog/FirstConfigure.cxx33
-rw-r--r--Source/QtDialog/FirstConfigure.h2
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx8
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx4
-rw-r--r--Source/QtDialog/WarningMessagesDialog.cxx24
7 files changed, 180 insertions, 149 deletions
diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index f5e0777..1075895 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -40,8 +40,10 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames,
AddCacheEntry::setTabOrder(string, this->Description);
QCompleter* completer = new QCompleter(this->VarNames, this);
this->Name->setCompleter(completer);
- connect(completer, SIGNAL(activated(const QString&)), this,
- SLOT(onCompletionActivated(const QString&)));
+ connect(
+ completer,
+ static_cast<void (QCompleter::*)(const QString&)>(&QCompleter::activated),
+ this, &AddCacheEntry::onCompletionActivated);
}
QString AddCacheEntry::name() const
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index fcc8408..f6bde8f 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -103,76 +103,87 @@ CMakeSetupDialog::CMakeSetupDialog()
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
- QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)), this,
- SLOT(doReloadCache()));
+ QObject::connect(this->ReloadCacheAction, &QAction::triggered, this,
+ &CMakeSetupDialog::doReloadCache);
this->DeleteCacheAction = FileMenu->addAction(tr("&Delete Cache"));
- QObject::connect(this->DeleteCacheAction, SIGNAL(triggered(bool)), this,
- SLOT(doDeleteCache()));
+ QObject::connect(this->DeleteCacheAction, &QAction::triggered, this,
+ &CMakeSetupDialog::doDeleteCache);
this->ExitAction = FileMenu->addAction(tr("E&xit"));
- this->ExitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
- QObject::connect(this->ExitAction, SIGNAL(triggered(bool)), this,
- SLOT(close()));
+ QObject::connect(this->ExitAction, &QAction::triggered, this,
+ &CMakeSetupDialog::close);
+ this->ExitAction->setShortcut(QKeySequence::Quit);
QMenu* ToolsMenu = this->menuBar()->addMenu(tr("&Tools"));
this->ConfigureAction = ToolsMenu->addAction(tr("&Configure"));
+ QObject::connect(this->ConfigureAction, &QAction::triggered, this,
+ &CMakeSetupDialog::doConfigure);
// prevent merging with Preferences menu item on macOS
this->ConfigureAction->setMenuRole(QAction::NoRole);
- QObject::connect(this->ConfigureAction, SIGNAL(triggered(bool)), this,
- SLOT(doConfigure()));
this->GenerateAction = ToolsMenu->addAction(tr("&Generate"));
- QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)), this,
- SLOT(doGenerate()));
- QAction* showChangesAction = ToolsMenu->addAction(tr("&Show My Changes"));
- QObject::connect(showChangesAction, SIGNAL(triggered(bool)), this,
- SLOT(showUserChanges()));
+ QObject::connect(this->GenerateAction, &QAction::triggered, this,
+ &CMakeSetupDialog::doGenerate);
+ auto* a = ToolsMenu->addAction(tr("&Show My Changes"));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::showUserChanges);
#if defined(Q_WS_MAC) || defined(Q_OS_MAC)
this->InstallForCommandLineAction =
ToolsMenu->addAction(tr("&How to Install For Command Line Use"));
- QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
- this, SLOT(doInstallForCommandLine()));
+ QObject::connect(this->InstallForCommandLineAction, &QAction::triggered,
+ this, &CMakeSetupDialog::doInstallForCommandLine);
#endif
ToolsMenu->addSeparator();
- ToolsMenu->addAction(tr("Regular Expression Explorer..."), this,
- SLOT(doRegexExplorerDialog()));
+ a = ToolsMenu->addAction(tr("Regular Expression Explorer..."));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doRegexExplorerDialog);
ToolsMenu->addSeparator();
- ToolsMenu->addAction(tr("&Find in Output..."), this,
- SLOT(doOutputFindDialog()), QKeySequence::Find);
- ToolsMenu->addAction(tr("Find Next"), this, SLOT(doOutputFindNext()),
- QKeySequence::FindNext);
- ToolsMenu->addAction(tr("Find Previous"), this, SLOT(doOutputFindPrev()),
- QKeySequence::FindPrevious);
- ToolsMenu->addAction(tr("Goto Next Error"), this, SLOT(doOutputErrorNext()),
- QKeySequence(Qt::Key_F8)); // in Visual Studio
- new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Period), this,
- SLOT(doOutputErrorNext())); // in Eclipse
+ a = ToolsMenu->addAction(tr("&Find in Output..."));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputFindDialog);
+ a->setShortcut(QKeySequence::Find);
+ a = ToolsMenu->addAction(tr("Find Next"));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputFindNext);
+ a->setShortcut(QKeySequence::FindNext);
+ a = ToolsMenu->addAction(tr("Find Previous"));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputFindPrev);
+ a->setShortcut(QKeySequence::FindPrevious);
+ a = ToolsMenu->addAction(tr("Goto Next Error")); // in Visual Studio
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputErrorNext);
+ a->setShortcut(QKeySequence(Qt::Key_F8));
+ auto* s = new QShortcut(this);
+ s->setKey(QKeySequence(Qt::CTRL + Qt::Key_Period));
+ QObject::connect(s, &QShortcut::activated, this,
+ &CMakeSetupDialog::doOutputErrorNext); // in Eclipse
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
- OptionsMenu->addAction(tr("Warning Messages..."), this,
- SLOT(doWarningMessagesDialog()));
+ a = OptionsMenu->addAction(tr("Warning Messages..."));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doWarningMessagesDialog);
this->WarnUninitializedAction =
OptionsMenu->addAction(tr("&Warn Uninitialized (--warn-uninitialized)"));
this->WarnUninitializedAction->setCheckable(true);
QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output"));
debugAction->setCheckable(true);
- QObject::connect(debugAction, SIGNAL(toggled(bool)), this,
- SLOT(setDebugOutput(bool)));
+ QObject::connect(debugAction, &QAction::toggled, this,
+ &CMakeSetupDialog::setDebugOutput);
OptionsMenu->addSeparator();
- QAction* expandAction =
- OptionsMenu->addAction(tr("&Expand Grouped Entries"));
- QObject::connect(expandAction, SIGNAL(triggered(bool)), this->CacheValues,
- SLOT(expandAll()));
- QAction* collapseAction =
- OptionsMenu->addAction(tr("&Collapse Grouped Entries"));
- QObject::connect(collapseAction, SIGNAL(triggered(bool)), this->CacheValues,
- SLOT(collapseAll()));
+ a = OptionsMenu->addAction(tr("&Expand Grouped Entries"));
+ QObject::connect(a, &QAction::triggered, this->CacheValues,
+ &QCMakeCacheView::expandAll);
+ a = OptionsMenu->addAction(tr("&Collapse Grouped Entries"));
+ QObject::connect(a, &QAction::triggered, this->CacheValues,
+ &QCMakeCacheView::collapseAll);
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
- QAction* a = HelpMenu->addAction(tr("About"));
- QObject::connect(a, SIGNAL(triggered(bool)), this, SLOT(doAbout()));
+ a = HelpMenu->addAction(tr("About"));
+ QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);
a = HelpMenu->addAction(tr("Help"));
- QObject::connect(a, SIGNAL(triggered(bool)), this, SLOT(doHelp()));
+ QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doHelp);
+ a->setShortcut(QKeySequence::HelpContents);
this->setAcceptDrops(true);
@@ -189,16 +200,16 @@ CMakeSetupDialog::CMakeSetupDialog()
this->ErrorFormat.setForeground(QBrush(Qt::red));
this->Output->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(this->Output, SIGNAL(customContextMenuRequested(const QPoint&)),
- this, SLOT(doOutputContextMenu(const QPoint&)));
+ connect(this->Output, &QTextEdit::customContextMenuRequested, this,
+ &CMakeSetupDialog::doOutputContextMenu);
// disable open project button
this->OpenProjectButton->setDisabled(true);
// start the cmake worker thread
this->CMakeThread = new QCMakeThread(this);
- QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()), this,
- SLOT(initialize()), Qt::QueuedConnection);
+ QObject::connect(this->CMakeThread, &QCMakeThread::cmakeInitialized, this,
+ &CMakeSetupDialog::initialize, Qt::QueuedConnection);
this->CMakeThread->start();
this->enterState(ReadyConfigure);
@@ -211,82 +222,79 @@ void CMakeSetupDialog::initialize()
{
// now the cmake worker thread is running, lets make our connections to it
QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(propertiesChanged(const QCMakePropertyList&)),
- this->CacheValues->cacheModel(),
- SLOT(setProperties(const QCMakePropertyList&)));
+ &QCMake::propertiesChanged, this->CacheValues->cacheModel(),
+ &QCMakeCacheModel::setProperties);
- QObject::connect(this->ConfigureButton, SIGNAL(clicked(bool)), this,
- SLOT(doConfigure()));
+ QObject::connect(this->ConfigureButton, &QPushButton::clicked, this,
+ &CMakeSetupDialog::doConfigure);
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(configureDone(int)), this, SLOT(exitLoop(int)));
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(generateDone(int)), this, SLOT(exitLoop(int)));
+ QObject::connect(this->CMakeThread->cmakeInstance(), &QCMake::configureDone,
+ this, &CMakeSetupDialog::exitLoop);
+ QObject::connect(this->CMakeThread->cmakeInstance(), &QCMake::generateDone,
+ this, &CMakeSetupDialog::exitLoop);
- QObject::connect(this->GenerateButton, SIGNAL(clicked(bool)), this,
- SLOT(doGenerate()));
- QObject::connect(this->OpenProjectButton, SIGNAL(clicked(bool)), this,
- SLOT(doOpenProject()));
+ QObject::connect(this->GenerateButton, &QPushButton::clicked, this,
+ &CMakeSetupDialog::doGenerate);
+ QObject::connect(this->OpenProjectButton, &QPushButton::clicked, this,
+ &CMakeSetupDialog::doOpenProject);
- QObject::connect(this->BrowseSourceDirectoryButton, SIGNAL(clicked(bool)),
- this, SLOT(doSourceBrowse()));
- QObject::connect(this->BrowseBinaryDirectoryButton, SIGNAL(clicked(bool)),
- this, SLOT(doBinaryBrowse()));
+ QObject::connect(this->BrowseSourceDirectoryButton, &QPushButton::clicked,
+ this, &CMakeSetupDialog::doSourceBrowse);
+ QObject::connect(this->BrowseBinaryDirectoryButton, &QPushButton::clicked,
+ this, &CMakeSetupDialog::doBinaryBrowse);
- QObject::connect(this->BinaryDirectory, SIGNAL(editTextChanged(QString)),
- this, SLOT(onBinaryDirectoryChanged(QString)));
- QObject::connect(this->SourceDirectory, SIGNAL(textChanged(QString)), this,
- SLOT(onSourceDirectoryChanged(QString)));
+ QObject::connect(this->BinaryDirectory, &QComboBox::editTextChanged, this,
+ &CMakeSetupDialog::onBinaryDirectoryChanged);
+ QObject::connect(this->SourceDirectory, &QLineEdit::textChanged, this,
+ &CMakeSetupDialog::onSourceDirectoryChanged);
QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(sourceDirChanged(QString)), this,
- SLOT(updateSourceDirectory(QString)));
+ &QCMake::sourceDirChanged, this,
+ &CMakeSetupDialog::updateSourceDirectory);
QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(binaryDirChanged(QString)), this,
- SLOT(updateBinaryDirectory(QString)));
+ &QCMake::binaryDirChanged, this,
+ &CMakeSetupDialog::updateBinaryDirectory);
QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(progressChanged(QString, float)), this,
- SLOT(showProgress(QString, float)));
+ &QCMake::progressChanged, this,
+ &CMakeSetupDialog::showProgress);
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(errorMessage(QString)), this, SLOT(error(QString)));
+ QObject::connect(this->CMakeThread->cmakeInstance(), &QCMake::errorMessage,
+ this, &CMakeSetupDialog::error);
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(outputMessage(QString)), this,
- SLOT(message(QString)));
+ QObject::connect(this->CMakeThread->cmakeInstance(), &QCMake::outputMessage,
+ this, &CMakeSetupDialog::message);
- QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(openPossible(bool)), this->OpenProjectButton,
- SLOT(setEnabled(bool)));
+ QObject::connect(this->CMakeThread->cmakeInstance(), &QCMake::openPossible,
+ this->OpenProjectButton, &CMakeSetupDialog::setEnabled);
- QObject::connect(this->groupedCheck, SIGNAL(toggled(bool)), this,
- SLOT(setGroupedView(bool)));
- QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)), this,
- SLOT(setAdvancedView(bool)));
- QObject::connect(this->Search, SIGNAL(textChanged(QString)), this,
- SLOT(setSearchFilter(QString)));
+ QObject::connect(this->groupedCheck, &QCheckBox::toggled, this,
+ &CMakeSetupDialog::setGroupedView);
+ QObject::connect(this->advancedCheck, &QCheckBox::toggled, this,
+ &CMakeSetupDialog::setAdvancedView);
+ QObject::connect(this->Search, &QLineEdit::textChanged, this,
+ &CMakeSetupDialog::setSearchFilter);
QObject::connect(this->CMakeThread->cmakeInstance(),
- SIGNAL(generatorChanged(QString)), this,
- SLOT(updateGeneratorLabel(QString)));
+ &QCMake::generatorChanged, this,
+ &CMakeSetupDialog::updateGeneratorLabel);
this->updateGeneratorLabel(QString());
QObject::connect(this->CacheValues->cacheModel(),
- SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
- SLOT(setCacheModified()));
+ &QCMakeCacheModel::dataChanged, this,
+ &CMakeSetupDialog::setCacheModified);
QObject::connect(this->CacheValues->selectionModel(),
- SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
- this, SLOT(selectionChanged()));
- QObject::connect(this->RemoveEntry, SIGNAL(clicked(bool)), this,
- SLOT(removeSelectedCacheEntries()));
- QObject::connect(this->AddEntry, SIGNAL(clicked(bool)), this,
- SLOT(addCacheEntry()));
-
- QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)),
+ &QItemSelectionModel::selectionChanged, this,
+ &CMakeSetupDialog::selectionChanged);
+ QObject::connect(this->RemoveEntry, &QToolButton::clicked, this,
+ &CMakeSetupDialog::removeSelectedCacheEntries);
+ QObject::connect(this->AddEntry, &QToolButton::clicked, this,
+ &CMakeSetupDialog::addCacheEntry);
+
+ QObject::connect(this->WarnUninitializedAction, &QAction::triggered,
this->CMakeThread->cmakeInstance(),
- SLOT(setWarnUninitializedMode(bool)));
+ &QCMake::setWarnUninitializedMode);
if (!this->SourceDirectory->text().isEmpty() ||
!this->BinaryDirectory->lineEdit()->text().isEmpty()) {
@@ -445,7 +453,8 @@ void CMakeSetupDialog::doInstallForCommandLine()
lab->setTextInteractionFlags(Qt::TextSelectableByMouse);
QDialogButtonBox* btns =
new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, &dialog);
- QObject::connect(btns, SIGNAL(accepted()), &dialog, SLOT(accept()));
+ QObject::connect(btns, &QDialogButtonBox::accepted, &dialog,
+ &QDialog::accept);
l->addWidget(btns);
dialog.exec();
}
@@ -602,7 +611,8 @@ void CMakeSetupDialog::doHelp()
lab->setWordWrap(true);
QDialogButtonBox* btns =
new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, &dialog);
- QObject::connect(btns, SIGNAL(accepted()), &dialog, SLOT(accept()));
+ QObject::connect(btns, &QDialogButtonBox::accepted, &dialog,
+ &QDialog::accept);
l->addWidget(lab);
l->addWidget(btns);
dialog.exec();
@@ -891,7 +901,8 @@ void CMakeSetupDialog::doAbout()
lab->setWordWrap(true);
QDialogButtonBox* btns =
new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, &dialog);
- QObject::connect(btns, SIGNAL(accepted()), &dialog, SLOT(accept()));
+ QObject::connect(btns, &QDialogButtonBox::accepted, &dialog,
+ &QDialog::accept);
l->addWidget(btns);
dialog.exec();
}
@@ -1074,8 +1085,10 @@ void CMakeSetupDialog::addCacheEntry()
new AddCacheEntry(&dialog, this->AddVariableNames, this->AddVariableTypes);
QDialogButtonBox* btns = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
- QObject::connect(btns, SIGNAL(accepted()), &dialog, SLOT(accept()));
- QObject::connect(btns, SIGNAL(rejected()), &dialog, SLOT(reject()));
+ QObject::connect(btns, &QDialogButtonBox::accepted, &dialog,
+ &QDialog::accept);
+ QObject::connect(btns, &QDialogButtonBox::rejected, &dialog,
+ &QDialog::reject);
l->addWidget(w);
l->addStretch();
l->addWidget(btns);
@@ -1153,7 +1166,8 @@ void CMakeSetupDialog::showUserChanges()
l->addWidget(textedit);
QDialogButtonBox* btns =
new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, &dialog);
- QObject::connect(btns, SIGNAL(rejected()), &dialog, SLOT(accept()));
+ QObject::connect(btns, &QDialogButtonBox::rejected, &dialog,
+ &QDialog::accept);
l->addWidget(btns);
QString command;
@@ -1207,15 +1221,23 @@ void CMakeSetupDialog::doOutputContextMenu(QPoint pt)
std::unique_ptr<QMenu> menu(this->Output->createStandardContextMenu());
menu->addSeparator();
- menu->addAction(tr("Find..."), this, SLOT(doOutputFindDialog()),
- QKeySequence::Find);
- menu->addAction(tr("Find Next"), this, SLOT(doOutputFindNext()),
- QKeySequence::FindNext);
- menu->addAction(tr("Find Previous"), this, SLOT(doOutputFindPrev()),
- QKeySequence::FindPrevious);
+ auto* a = menu->addAction(tr("Find..."));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputFindDialog);
+ a->setShortcut(QKeySequence::Find);
+ a = menu->addAction(tr("Find Next"));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputFindNext);
+ a->setShortcut(QKeySequence::FindNext);
+ a = menu->addAction(tr("Find Previous"));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputFindPrev);
+ a->setShortcut(QKeySequence::FindPrevious);
menu->addSeparator();
- menu->addAction(tr("Goto Next Error"), this, SLOT(doOutputErrorNext()),
- QKeySequence(Qt::Key_F8));
+ a = menu->addAction(tr("Goto Next Error"));
+ QObject::connect(a, &QAction::triggered, this,
+ &CMakeSetupDialog::doOutputErrorNext);
+ a->setShortcut(QKeySequence(Qt::Key_F8));
menu->exec(this->Output->mapToGlobal(pt));
}
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index 3c24b9b..918f137 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -47,17 +47,18 @@ StartCompilerSetup::StartCompilerSetup(QString defaultGeneratorPlatform,
this->CompilerSetupOptions[0]->setChecked(true);
- QObject::connect(this->CompilerSetupOptions[0], SIGNAL(toggled(bool)), this,
- SLOT(onSelectionChanged(bool)));
- QObject::connect(this->CompilerSetupOptions[1], SIGNAL(toggled(bool)), this,
- SLOT(onSelectionChanged(bool)));
- QObject::connect(this->CompilerSetupOptions[2], SIGNAL(toggled(bool)), this,
- SLOT(onSelectionChanged(bool)));
- QObject::connect(this->CompilerSetupOptions[3], SIGNAL(toggled(bool)), this,
- SLOT(onSelectionChanged(bool)));
- QObject::connect(this->GeneratorOptions,
- SIGNAL(currentIndexChanged(QString const&)), this,
- SLOT(onGeneratorChanged(QString const&)));
+ QObject::connect(this->CompilerSetupOptions[0], &QRadioButton::toggled, this,
+ &StartCompilerSetup::onSelectionChanged);
+ QObject::connect(this->CompilerSetupOptions[1], &QRadioButton::toggled, this,
+ &StartCompilerSetup::onSelectionChanged);
+ QObject::connect(this->CompilerSetupOptions[2], &QRadioButton::toggled, this,
+ &StartCompilerSetup::onSelectionChanged);
+ QObject::connect(this->CompilerSetupOptions[3], &QRadioButton::toggled, this,
+ &StartCompilerSetup::onSelectionChanged);
+ QObject::connect(
+ this->GeneratorOptions,
+ static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &StartCompilerSetup::onGeneratorChanged);
}
QFrame* StartCompilerSetup::CreateToolsetWidgets()
@@ -186,8 +187,10 @@ void StartCompilerSetup::onSelectionChanged(bool on)
}
}
-void StartCompilerSetup::onGeneratorChanged(QString const& name)
+void StartCompilerSetup::onGeneratorChanged(int index)
{
+ QString name = this->GeneratorOptions->itemText(index);
+
// Display the generator platform for the generators supporting it
if (GeneratorsSupportingPlatform.contains(name)) {
@@ -458,9 +461,9 @@ FirstConfigure::FirstConfigure()
this->mStartCompilerSetupPage = new StartCompilerSetup(
env_generator_platform, env_generator_toolset, this);
this->setPage(Start, this->mStartCompilerSetupPage);
- QObject::connect(this->mStartCompilerSetupPage, SIGNAL(selectionChanged()),
- this, SLOT(restart()));
-
+ QObject::connect(this->mStartCompilerSetupPage,
+ &StartCompilerSetup::selectionChanged, this,
+ &FirstConfigure::restart);
this->mNativeCompilerSetupPage = new NativeCompilerSetup(this);
this->setPage(NativeSetup, this->mNativeCompilerSetupPage);
diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h
index 4c757da..ca5f52e 100644
--- a/Source/QtDialog/FirstConfigure.h
+++ b/Source/QtDialog/FirstConfigure.h
@@ -49,7 +49,7 @@ signals:
protected slots:
void onSelectionChanged(bool);
- void onGeneratorChanged(QString const& name);
+ void onGeneratorChanged(int index);
protected:
QComboBox* GeneratorOptions;
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 3bf4409..4f4b218 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -576,15 +576,15 @@ QWidget* QCMakeCacheModelDelegate::createEditor(
if (type == QCMakeProperty::PATH) {
QCMakePathEditor* editor =
new QCMakePathEditor(p, var.data(Qt::DisplayRole).toString());
- QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
- SLOT(setFileDialogFlag(bool)));
+ QObject::connect(editor, &QCMakePathEditor::fileDialogExists, this,
+ &QCMakeCacheModelDelegate::setFileDialogFlag);
return editor;
}
if (type == QCMakeProperty::FILEPATH) {
QCMakeFilePathEditor* editor =
new QCMakeFilePathEditor(p, var.data(Qt::DisplayRole).toString());
- QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
- SLOT(setFileDialogFlag(bool)));
+ QObject::connect(editor, &QCMakePathEditor::fileDialogExists, this,
+ &QCMakeCacheModelDelegate::setFileDialogFlag);
return editor;
}
if (type == QCMakeProperty::STRING &&
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index d16ea58..1fc839f 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -17,8 +17,8 @@ QCMakeFileEditor::QCMakeFileEditor(QWidget* p, QString var)
this->ToolButton = new QToolButton(this);
this->ToolButton->setText("...");
this->ToolButton->setCursor(QCursor(Qt::ArrowCursor));
- QObject::connect(this->ToolButton, SIGNAL(clicked(bool)), this,
- SLOT(chooseFile()));
+ QObject::connect(this->ToolButton, &QToolButton::clicked, this,
+ &QCMakeFileEditor::chooseFile);
}
QCMakeFilePathEditor::QCMakeFilePathEditor(QWidget* p, const QString& var)
diff --git a/Source/QtDialog/WarningMessagesDialog.cxx b/Source/QtDialog/WarningMessagesDialog.cxx
index f608a84..1fcf2b1 100644
--- a/Source/QtDialog/WarningMessagesDialog.cxx
+++ b/Source/QtDialog/WarningMessagesDialog.cxx
@@ -26,18 +26,22 @@ void WarningMessagesDialog::setInitialValues()
void WarningMessagesDialog::setupSignals()
{
- QObject::connect(this->buttonBox, SIGNAL(accepted()), this,
- SLOT(doAccept()));
+ QObject::connect(this->buttonBox, &QDialogButtonBox::accepted, this,
+ &WarningMessagesDialog::doAccept);
- QObject::connect(this->suppressDeveloperWarnings, SIGNAL(stateChanged(int)),
- this, SLOT(doSuppressDeveloperWarningsChanged(int)));
- QObject::connect(this->suppressDeprecatedWarnings, SIGNAL(stateChanged(int)),
- this, SLOT(doSuppressDeprecatedWarningsChanged(int)));
+ QObject::connect(this->suppressDeveloperWarnings, &QCheckBox::stateChanged,
+ this,
+ &WarningMessagesDialog::doSuppressDeveloperWarningsChanged);
+ QObject::connect(
+ this->suppressDeprecatedWarnings, &QCheckBox::stateChanged, this,
+ &WarningMessagesDialog::doSuppressDeprecatedWarningsChanged);
- QObject::connect(this->developerWarningsAsErrors, SIGNAL(stateChanged(int)),
- this, SLOT(doDeveloperWarningsAsErrorsChanged(int)));
- QObject::connect(this->deprecatedWarningsAsErrors, SIGNAL(stateChanged(int)),
- this, SLOT(doDeprecatedWarningsAsErrorsChanged(int)));
+ QObject::connect(this->developerWarningsAsErrors, &QCheckBox::stateChanged,
+ this,
+ &WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged);
+ QObject::connect(
+ this->deprecatedWarningsAsErrors, &QCheckBox::stateChanged, this,
+ &WarningMessagesDialog::doDeprecatedWarningsAsErrorsChanged);
}
void WarningMessagesDialog::doAccept()