diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-03-27 11:56:25 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-04-01 20:36:49 +0000 |
commit | 47e576528e4f61c1e387e7ee89bc6b18b7ce3d94 (patch) | |
tree | 8b24fc1f92f709530854abe8e3aea31804ce00a1 /src/plugins/coreplugin/variablechooser.cpp | |
parent | 553c3c2c74f631598dfda3e8a026ed1dc358626a (diff) | |
download | qt-creator-47e576528e4f61c1e387e7ee89bc6b18b7ce3d94.tar.gz |
Port QtCreator over to use filterRegularExpression
QSortFilterProxyModel::filterRegExp is going to go away in Qt6,
so port over to use QRegularExpression instead.
This required some changes where setFilterWildcard/FixedString()
was being used, as those would instantiate QRegExp based filters
in Qt 5, and will use QRegularExpression in Qt 6. Use the generic
setFilterRegularExpression here, to keep things portable between
5 and 6.
Change-Id: I6379be781aa3821b10ba783c088f82c1a0970911
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/variablechooser.cpp')
-rw-r--r-- | src/plugins/coreplugin/variablechooser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/variablechooser.cpp b/src/plugins/coreplugin/variablechooser.cpp index 5766818029..f196dabb37 100644 --- a/src/plugins/coreplugin/variablechooser.cpp +++ b/src/plugins/coreplugin/variablechooser.cpp @@ -90,8 +90,8 @@ public: if (!index.isValid()) return false; - const QRegExp regexp = filterRegExp(); - if (regexp.isEmpty() || sourceModel()->rowCount(index) > 0) + const QRegularExpression regexp = filterRegularExpression(); + if (regexp.pattern().isEmpty() || sourceModel()->rowCount(index) > 0) return true; const QString displayText = index.data(Qt::DisplayRole).toString(); @@ -548,7 +548,7 @@ void VariableChooserPrivate::updatePositionAndShow(bool) void VariableChooserPrivate::updateFilter(const QString &filterText) { - m_sortModel->setFilterWildcard(filterText); + m_sortModel->setFilterRegularExpression(QRegularExpression::wildcardToRegularExpression(filterText)); m_variableTree->expandAll(); } |