diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2019-12-03 20:24:38 +0100 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2020-01-17 11:31:35 +0100 |
commit | c6899f16389458766904d8d913054f09076e06dd (patch) | |
tree | e24f942a01720775391ae04557e24a35839f7361 /src/qmltest | |
parent | 9e674be4fb8c369873a009f58e3152a12d2c4cce (diff) |
Replace QVariant::type with QVariant::userType
as type is going to be deprecated.
This change was done automatically with the help of clazy.
In addition, ColumnRoleMetadata was changed to take an int instead
of a QVariant::Type
Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qmltest')
-rw-r--r-- | src/qmltest/quicktestresult.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index 49552e1901..d5ab267cec 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -500,8 +500,8 @@ bool QuickTestResult::verify bool QuickTestResult::fuzzyCompare(const QVariant &actual, const QVariant &expected, qreal delta) { - if (actual.type() == QVariant::Color || expected.type() == QVariant::Color) { - if (!actual.canConvert(QVariant::Color) || !expected.canConvert(QVariant::Color)) + if (actual.userType() == QMetaType::QColor || expected.userType() == QMetaType::QColor) { + if (!actual.canConvert(QMetaType::QColor) || !expected.canConvert(QMetaType::QColor)) return false; //fuzzy color comparison @@ -556,20 +556,20 @@ void QuickTestResult::stringify(QQmlV4Function *args) && !value->as<QV4::ArrayObject>()) { QVariant v = scope.engine->toVariant(value, QMetaType::UnknownType); if (v.isValid()) { - switch (v.type()) { - case QVariant::Vector3D: + switch (v.userType()) { + case QMetaType::QVector3D: { QVector3D v3d = v.value<QVector3D>(); result = QString::fromLatin1("Qt.vector3d(%1, %2, %3)").arg(v3d.x()).arg(v3d.y()).arg(v3d.z()); break; } - case QVariant::Url: + case QMetaType::QUrl: { QUrl url = v.value<QUrl>(); result = QString::fromLatin1("Qt.url(%1)").arg(url.toString()); break; } - case QVariant::DateTime: + case QMetaType::QDateTime: { QDateTime dt = v.value<QDateTime>(); result = dt.toString(Qt::ISODateWithMs); |