summaryrefslogtreecommitdiff
path: root/src/libs/utils/categorysortfiltermodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/utils/categorysortfiltermodel.cpp')
-rw-r--r--src/libs/utils/categorysortfiltermodel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libs/utils/categorysortfiltermodel.cpp b/src/libs/utils/categorysortfiltermodel.cpp
index ab1769f8bd..c53216dabf 100644
--- a/src/libs/utils/categorysortfiltermodel.cpp
+++ b/src/libs/utils/categorysortfiltermodel.cpp
@@ -25,6 +25,8 @@
#include "categorysortfiltermodel.h"
+#include <QRegularExpression>
+
namespace Utils {
CategorySortFilterModel::CategorySortFilterModel(QObject *parent)
@@ -37,9 +39,9 @@ bool CategorySortFilterModel::filterAcceptsRow(int source_row,
{
if (!source_parent.isValid()) {
// category items should be visible if any of its children match
- const QRegExp &regexp = filterRegExp();
+ const QRegularExpression &regexp = filterRegularExpression();
const QModelIndex &categoryIndex = sourceModel()->index(source_row, 0, source_parent);
- if (regexp.indexIn(sourceModel()->data(categoryIndex, filterRole()).toString()) != -1)
+ if (regexp.match(sourceModel()->data(categoryIndex, filterRole()).toString()).hasMatch())
return true;
const int rowCount = sourceModel()->rowCount(categoryIndex);
for (int row = 0; row < rowCount; ++row) {