From 9ec50ff157f064ba07c9e1229f84a8cd16fff87d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 4 Mar 2021 11:25:54 -0500 Subject: [PATCH] cmake-gui: Restore search bar case insensitivity Since these changes: * commit f1de6f6682 (cmake-gui: Support building against Qt6, 2020-12-17, v3.20.0-rc1~205^2~7) * commit 134d69121e (cmake-gui: Restore search bar for cache view and environment dialog, 2021-02-22, v3.20.0-rc2~12^2) the search bar is no longer case insensitive when using Qt 5.12.[0-1], and possibly some later versions. It works as of Qt 5.15 though, so update our version check accordingly. Fixes: #21884 --- Source/QtDialog/EnvironmentDialog.cxx | 4 ++-- Source/QtDialog/QCMakeCacheView.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/QtDialog/EnvironmentDialog.cxx b/Source/QtDialog/EnvironmentDialog.cxx index 9c8e892c17..bf898162ca 100644 --- a/Source/QtDialog/EnvironmentDialog.cxx +++ b/Source/QtDialog/EnvironmentDialog.cxx @@ -81,7 +81,7 @@ bool EnvironmentSearchFilter::filterAcceptsRow(int row, auto* model = this->sourceModel(); auto key = model->data(model->index(row, 0, parent), Qt::DisplayRole).toString(); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) return key.contains(this->filterRegularExpression()); #else return key.contains(this->filterRegExp()); @@ -110,7 +110,7 @@ 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)) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) QObject::connect(this->Search, &QLineEdit::textChanged, this->m_filter, QOverload::of( &EnvironmentSearchFilter::setFilterRegularExpression)); diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 536b92dc40..994df78a80 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -47,7 +47,7 @@ protected: // check all strings for a match foreach (QString const& str, strs) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) if (str.contains(this->filterRegularExpression())) { #else if (str.contains(this->filterRegExp())) { @@ -170,7 +170,7 @@ bool QCMakeCacheView::showAdvanced() const void QCMakeCacheView::setSearchFilter(const QString& s) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) this->SearchFilter->setFilterRegularExpression(s); #else this->SearchFilter->setFilterFixedString(s);