diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-03-18 16:56:26 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-03-30 11:33:07 +0100 |
commit | 3532c0256d4a64f8493f9773f25b6ce7f12b2230 (patch) | |
tree | a66dccf6c1abe577f89df4e924d4c035a368ab01 /src | |
parent | 2e0070d42c0bff5074eb9494ba0e561b91f0622b (diff) |
Make MatchRegExp an alias to MatchRegularExpression
All matching happens using QRegularExpression now.
Change-Id: I10bfcefbf4d9c79d235242e3e05116cdf7af02d1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.h | 4 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 3 | ||||
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.cpp | 7 | ||||
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 2 |
4 files changed, 4 insertions, 12 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 8851e08d4f..ffc3989815 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 3e22c9e661..cff2fab398 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 41bdaa2ac5..57a6c2f239 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 72fa557790..c02649f20c 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: |