summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-23 13:07:25 +0000
committerKitware Robot <kwrobot@kitware.com>2021-02-23 08:07:31 -0500
commit8362915b9dc33bc31289aa4c9b4816753ea548b2 (patch)
treec7d8052d75c19cd89a7adde40b051e3cbb816acf
parente1ea0c9540e1ee1792833f7b02ad3afc1385c290 (diff)
parent134d69121e893426db2ea67a6bc6e22a749b6529 (diff)
downloadcmake-8362915b9dc33bc31289aa4c9b4816753ea548b2.tar.gz
Merge topic 'cmake-gui-restore-search' into release-3.20
134d69121e cmake-gui: Restore search bar for cache view and environment dialog Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5845
-rw-r--r--Source/QtDialog/EnvironmentDialog.cxx6
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx4
2 files changed, 10 insertions, 0 deletions
diff --git a/Source/QtDialog/EnvironmentDialog.cxx b/Source/QtDialog/EnvironmentDialog.cxx
index 0339d1d63f..9c8e892c17 100644
--- a/Source/QtDialog/EnvironmentDialog.cxx
+++ b/Source/QtDialog/EnvironmentDialog.cxx
@@ -110,8 +110,14 @@ EnvironmentDialog::EnvironmentDialog(const QProcessEnvironment& environment,
&EnvironmentDialog::addEntry);
QObject::connect(this->RemoveEntry, &QAbstractButton::clicked, this,
&EnvironmentDialog::removeSelectedEntries);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ QObject::connect(this->Search, &QLineEdit::textChanged, this->m_filter,
+ QOverload<const QString&>::of(
+ &EnvironmentSearchFilter::setFilterRegularExpression));
+#else
QObject::connect(this->Search, &QLineEdit::textChanged, this->m_filter,
&EnvironmentSearchFilter::setFilterFixedString);
+#endif
QObject::connect(this->Environment->selectionModel(),
&QItemSelectionModel::selectionChanged, this,
&EnvironmentDialog::selectionChanged);
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 7c9032e186..536b92dc40 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -170,7 +170,11 @@ bool QCMakeCacheView::showAdvanced() const
void QCMakeCacheView::setSearchFilter(const QString& s)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ this->SearchFilter->setFilterRegularExpression(s);
+#else
this->SearchFilter->setFilterFixedString(s);
+#endif
}
QCMakeCacheModel::QCMakeCacheModel(QObject* p)