mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 21:40:15 +08:00
cmake-gui: Restore search bar for cache view and environment dialog
This was broken by commit f1de6f6682
(cmake-gui: Support building
against Qt6, 2020-12-17, v3.20.0-rc1~205^2~7).
Fixes: #21850
This commit is contained in:

committed by
Brad King

parent
e9efa04d8d
commit
134d69121e
@@ -110,8 +110,14 @@ EnvironmentDialog::EnvironmentDialog(const QProcessEnvironment& environment,
|
|||||||
&EnvironmentDialog::addEntry);
|
&EnvironmentDialog::addEntry);
|
||||||
QObject::connect(this->RemoveEntry, &QAbstractButton::clicked, this,
|
QObject::connect(this->RemoveEntry, &QAbstractButton::clicked, this,
|
||||||
&EnvironmentDialog::removeSelectedEntries);
|
&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,
|
QObject::connect(this->Search, &QLineEdit::textChanged, this->m_filter,
|
||||||
&EnvironmentSearchFilter::setFilterFixedString);
|
&EnvironmentSearchFilter::setFilterFixedString);
|
||||||
|
#endif
|
||||||
QObject::connect(this->Environment->selectionModel(),
|
QObject::connect(this->Environment->selectionModel(),
|
||||||
&QItemSelectionModel::selectionChanged, this,
|
&QItemSelectionModel::selectionChanged, this,
|
||||||
&EnvironmentDialog::selectionChanged);
|
&EnvironmentDialog::selectionChanged);
|
||||||
|
@@ -170,7 +170,11 @@ bool QCMakeCacheView::showAdvanced() const
|
|||||||
|
|
||||||
void QCMakeCacheView::setSearchFilter(const QString& s)
|
void QCMakeCacheView::setSearchFilter(const QString& s)
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
||||||
|
this->SearchFilter->setFilterRegularExpression(s);
|
||||||
|
#else
|
||||||
this->SearchFilter->setFilterFixedString(s);
|
this->SearchFilter->setFilterFixedString(s);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QCMakeCacheModel::QCMakeCacheModel(QObject* p)
|
QCMakeCacheModel::QCMakeCacheModel(QObject* p)
|
||||||
|
Reference in New Issue
Block a user