summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/EnvironmentDialog.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/QtDialog/EnvironmentDialog.cxx')
-rw-r--r--Source/QtDialog/EnvironmentDialog.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/QtDialog/EnvironmentDialog.cxx b/Source/QtDialog/EnvironmentDialog.cxx
index bf89816..2752c0f 100644
--- a/Source/QtDialog/EnvironmentDialog.cxx
+++ b/Source/QtDialog/EnvironmentDialog.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "EnvironmentDialog.h"
+#include "QCMakeWidgets.h"
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QItemSelectionModel>
@@ -110,14 +111,11 @@ EnvironmentDialog::EnvironmentDialog(const QProcessEnvironment& environment,
&EnvironmentDialog::addEntry);
QObject::connect(this->RemoveEntry, &QAbstractButton::clicked, this,
&EnvironmentDialog::removeSelectedEntries);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 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->Search, &QLineEdit::textChanged, [this](const QString& text) {
+ const bool valid = QtCMake::setSearchFilter(this->m_filter, text);
+ QtCMake::setSearchFilterColor(this->Search, valid);
+ });
QObject::connect(this->Environment->selectionModel(),
&QItemSelectionModel::selectionChanged, this,
&EnvironmentDialog::selectionChanged);