diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 8851e08d4fc..ffc3989815e 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1560,12 +1560,12 @@ namespace Qt { MatchContains = 1, MatchStartsWith = 2, MatchEndsWith = 3, + MatchRegularExpression = 4, #if QT_DEPRECATED_SINCE(5, 15) - MatchRegExp Q_DECL_ENUMERATOR_DEPRECATED_X("MatchRegExp is deprecated. Use MatchRegularExpression instead") = 4, + MatchRegExp Q_DECL_ENUMERATOR_DEPRECATED_X("MatchRegExp is deprecated. Use MatchRegularExpression instead") = MatchRegularExpression, #endif MatchWildcard = 5, MatchFixedString = 8, - MatchRegularExpression = 9, MatchCaseSensitive = 16, MatchWrap = 32, MatchRecursive = 64 diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 3e22c9e661d..cff2fab398b 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2875,8 +2875,7 @@ \value MatchStartsWith The search term matches the start of the item. \value MatchEndsWith The search term matches the end of the item. \value MatchCaseSensitive The search is case sensitive. - \value MatchRegExp Performs string-based matching using a regular - expression as the search term. Uses the deprecated QRegExp class. + \value MatchRegExp Same as MatchRegularExpression \e{This enum value is deprecated since Qt 5.15.} \value MatchRegularExpression Performs string-based matching using a regular expression as the search term. Uses QRegularExpression. diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 41bdaa2ac57..57a6c2f2393 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -2408,13 +2408,6 @@ QModelIndexList QAbstractItemModel::match(const QModelIndex &start, int role, QString t = v.toString(); switch (matchType) { -#if QT_DEPRECATED_SINCE(5, 15) - case Qt::MatchRegExp: - if (QRegExp(text, cs).exactMatch(t)) - result.append(idx); - break; -#endif - #if QT_CONFIG(regularexpression) case Qt::MatchRegularExpression: Q_FALLTHROUGH(); diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 72fa5577907..c02649f20ca 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -757,7 +757,7 @@ int QUnsortedModelEngine::buildIndices(const QString& str, const QModelIndex& pa case Qt::MatchExactly: case Qt::MatchFixedString: case Qt::MatchCaseSensitive: - case Qt::MatchRegExp: + case Qt::MatchRegularExpression: case Qt::MatchWildcard: case Qt::MatchWrap: case Qt::MatchRecursive: diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp index 9fab36deaa8..20255b996ef 100644 --- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -449,9 +449,9 @@ void tst_QAbstractItemModel::match() QCOMPARE(res.count(), 2); res = model.match(start, Qt::DisplayRole, QVariant("*a*"), -1, Qt::MatchWildcard); QCOMPARE(res.count(), 3); - res = model.match(start, Qt::DisplayRole, QVariant(".*O.*"), -1, Qt::MatchRegExp); + res = model.match(start, Qt::DisplayRole, QVariant(".*O.*"), -1, Qt::MatchRegularExpression); QCOMPARE(res.count(), 2); - res = model.match(start, Qt::DisplayRole, QVariant(".*O.*"), -1, Qt::MatchRegExp | Qt::MatchCaseSensitive); + res = model.match(start, Qt::DisplayRole, QVariant(".*O.*"), -1, Qt::MatchRegularExpression | Qt::MatchCaseSensitive); QCOMPARE(res.count(), 0); res = model.match(start, Qt::DisplayRole, QVariant("BOAR"), -1, Qt::MatchFixedString); QCOMPARE(res.count(), 1);