diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2019-12-02 17:54:48 +0100 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2020-01-23 16:46:51 +0100 |
commit | 73d1476fb1397948a4d806bd921fce372bd8d63b (patch) | |
tree | a476349c26627027d78c1279da00ef633323311f /src/testlib | |
parent | a78d66743171557d79b16c08be775e3ac15bb4ef (diff) |
Replace most use of QVariant::type and occurrences of QVariant::Type
I made a clazy automated check that replaced the use of QVariant::Type
by the equivalent in QMetaType.
This has been deprecated since Qt 5.0, but many uses were not yet removed.
In addition, there was some manual changes to fix the compilation errors.
Adapted the Private API of QDateTimeParser and QMimeDataPrivate
and adjust QDateTimeEdit and QSpinBox.
QVariant(QVariant::Invalid) in qstylesheet made no sense.
But note that in QVariant::save, we actually wanted to use the non-user type.
In the SQL module, many changes were actually reverted because the API
still expects QVarient::Type.
Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtest.h | 2 | ||||
-rw-r--r-- | src/testlib/qtestlog.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 3b1ffb389e..0298ff96e3 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -218,7 +218,7 @@ template<> inline char *toString(const QVariant &v) vstring.append(type); if (!v.isNull()) { vstring.append(','); - if (v.canConvert(QVariant::String)) { + if (v.canConvert(QMetaType::QString)) { vstring.append(v.toString().toLocal8Bit()); } else { diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index f3ebf343c5..2776740784 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -152,7 +152,7 @@ namespace QTest { inline bool matches(QtMsgType tp, const QString &message) const { return tp == type - && (pattern.type() == QVariant::String ? + && (pattern.userType() == QMetaType::QString ? stringsMatch(pattern.toString(), message) : #if QT_CONFIG(regularexpression) pattern.toRegularExpression().match(message).hasMatch()); @@ -292,7 +292,7 @@ void QTestLog::printUnhandledIgnoreMessages() QString message; QTest::IgnoreResultList *list = QTest::ignoreResultList; while (list) { - if (list->pattern.type() == QVariant::String) { + if (list->pattern.userType() == QMetaType::QString) { message = QStringLiteral("Did not receive message: \"") + list->pattern.toString() + QLatin1Char('"'); } else { #if QT_CONFIG(regularexpression) |