summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-02 01:10:13 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-12 23:04:57 +0200
commit9887f32df91c579f5e891d16d9be9d9e3b8c4e17 (patch)
treea53692590996942a93b281a8378dedf8fc3c3457 /src/corelib/itemmodels
parentcdd6a1f1384a43dbf2627c4d1cade6508e5762bb (diff)
QAbstractItemModel::match: code tidies
Remove a magic number from the code, by adding it (as a private value) to the right enumeration. Use toInt() to convert to integer. Change-Id: Id1b00dde900619684b5a3df247d46938439150ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 8da33e0c4e..ca04eb6a31 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2533,7 +2533,7 @@ QModelIndexList QAbstractItemModel::match(const QModelIndex &start, int role,
Qt::MatchFlags flags) const
{
QModelIndexList result;
- uint matchType = flags & 0x0F;
+ uint matchType = (flags & Qt::MatchTypeMask).toInt();
Qt::CaseSensitivity cs = flags & Qt::MatchCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive;
bool recurse = flags & Qt::MatchRecursive;
bool wrap = flags & Qt::MatchWrap;