diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2021-01-15 16:21:07 (GMT) |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2021-01-15 16:21:07 (GMT) |
commit | 0bc327a79ca4d875df6084d490c4fd7da315a33a (patch) | |
tree | e0a237a08b0f3db5573f4c667783c264d64d7485 /Source/QtDialog | |
parent | 6baffecab94e2378bd6f054db31baf10dafa176e (diff) | |
download | CMake-0bc327a79ca4d875df6084d490c4fd7da315a33a.zip CMake-0bc327a79ca4d875df6084d490c4fd7da315a33a.tar.gz CMake-0bc327a79ca4d875df6084d490c4fd7da315a33a.tar.bz2 |
CMake GUI: Improve signal specification
Don't use subclasses to connect to QAbstractButton::clicked. This is
slightly dodgy, but of more immediate importance, tweaking it will allow
us to change the widget type of some QToolButton instances that should
be QPushButton.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 22 | ||||
-rw-r--r-- | Source/QtDialog/EnvironmentDialog.cxx | 4 | ||||
-rw-r--r-- | Source/QtDialog/QCMakeWidgets.cxx | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 05518a9..7c4d96b 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -253,7 +253,7 @@ void CMakeSetupDialog::initialize() &QCMake::propertiesChanged, this->CacheValues->cacheModel(), &QCMakeCacheModel::setProperties); - QObject::connect(this->ConfigureButton, &QPushButton::clicked, this, + QObject::connect(this->ConfigureButton, &QAbstractButton::clicked, this, &CMakeSetupDialog::doConfigure); QObject::connect(this->CMakeThread->cmakeInstance(), &QCMake::configureDone, @@ -261,15 +261,17 @@ void CMakeSetupDialog::initialize() QObject::connect(this->CMakeThread->cmakeInstance(), &QCMake::generateDone, this, &CMakeSetupDialog::exitLoop); - QObject::connect(this->GenerateButton, &QPushButton::clicked, this, + QObject::connect(this->GenerateButton, &QAbstractButton::clicked, this, &CMakeSetupDialog::doGenerate); - QObject::connect(this->OpenProjectButton, &QPushButton::clicked, this, + QObject::connect(this->OpenProjectButton, &QAbstractButton::clicked, this, &CMakeSetupDialog::doOpenProject); - QObject::connect(this->BrowseSourceDirectoryButton, &QPushButton::clicked, - this, &CMakeSetupDialog::doSourceBrowse); - QObject::connect(this->BrowseBinaryDirectoryButton, &QPushButton::clicked, - this, &CMakeSetupDialog::doBinaryBrowse); + QObject::connect(this->BrowseSourceDirectoryButton, + &QAbstractButton::clicked, this, + &CMakeSetupDialog::doSourceBrowse); + QObject::connect(this->BrowseBinaryDirectoryButton, + &QAbstractButton::clicked, this, + &CMakeSetupDialog::doBinaryBrowse); QObject::connect(this->BinaryDirectory, &QComboBox::editTextChanged, this, &CMakeSetupDialog::onBinaryDirectoryChanged); @@ -324,12 +326,12 @@ void CMakeSetupDialog::initialize() QObject::connect(this->CacheValues->selectionModel(), &QItemSelectionModel::selectionChanged, this, &CMakeSetupDialog::selectionChanged); - QObject::connect(this->RemoveEntry, &QToolButton::clicked, this, + QObject::connect(this->RemoveEntry, &QAbstractButton::clicked, this, &CMakeSetupDialog::removeSelectedCacheEntries); - QObject::connect(this->AddEntry, &QToolButton::clicked, this, + QObject::connect(this->AddEntry, &QAbstractButton::clicked, this, &CMakeSetupDialog::addCacheEntry); - QObject::connect(this->Environment, &QToolButton::clicked, this, + QObject::connect(this->Environment, &QAbstractButton::clicked, this, &CMakeSetupDialog::editEnvironment); QObject::connect(this->WarnUninitializedAction, &QAction::triggered, diff --git a/Source/QtDialog/EnvironmentDialog.cxx b/Source/QtDialog/EnvironmentDialog.cxx index d4f978c..0339d1d 100644 --- a/Source/QtDialog/EnvironmentDialog.cxx +++ b/Source/QtDialog/EnvironmentDialog.cxx @@ -106,9 +106,9 @@ EnvironmentDialog::EnvironmentDialog(const QProcessEnvironment& environment, this->Environment->setSelectionMode(QAbstractItemView::ExtendedSelection); this->Environment->setSelectionBehavior(QAbstractItemView::SelectRows); - QObject::connect(this->AddEntry, &QToolButton::clicked, this, + QObject::connect(this->AddEntry, &QAbstractButton::clicked, this, &EnvironmentDialog::addEntry); - QObject::connect(this->RemoveEntry, &QToolButton::clicked, this, + QObject::connect(this->RemoveEntry, &QAbstractButton::clicked, this, &EnvironmentDialog::removeSelectedEntries); QObject::connect(this->Search, &QLineEdit::textChanged, this->m_filter, &EnvironmentSearchFilter::setFilterFixedString); diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx index ca65d13..03d6ed1 100644 --- a/Source/QtDialog/QCMakeWidgets.cxx +++ b/Source/QtDialog/QCMakeWidgets.cxx @@ -25,7 +25,7 @@ QCMakeFileEditor::QCMakeFileEditor(QWidget* p, QString var) this->ToolButton = new QToolButton(this); this->ToolButton->setText("..."); this->ToolButton->setCursor(QCursor(Qt::ArrowCursor)); - QObject::connect(this->ToolButton, &QToolButton::clicked, this, + QObject::connect(this->ToolButton, &QAbstractButton::clicked, this, &QCMakeFileEditor::chooseFile); } |