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/plugins/generic | |
parent | a78d66743171557d79b16c08be775e3ac15bb4ef (diff) | |
download | qtbase-73d1476fb1397948a4d806bd921fce372bd8d63b.tar.gz |
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/plugins/generic')
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiohandler.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp index cb82672acd..6ad4597b19 100644 --- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp +++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp @@ -226,7 +226,7 @@ void QTuioHandler::process2DCurSource(const QOscMessage &message) return; } - if (QMetaType::Type(arguments.at(1).type()) != QMetaType::QByteArray) { + if (QMetaType::Type(arguments.at(1).userType()) != QMetaType::QByteArray) { qCWarning(lcTuioSource, "Ignoring malformed TUIO source message (bad argument type)"); return; } @@ -248,7 +248,7 @@ void QTuioHandler::process2DCurAlive(const QOscMessage &message) QMap<int, QTuioCursor> newActiveCursors; for (int i = 1; i < arguments.count(); ++i) { - if (QMetaType::Type(arguments.at(i).type()) != QMetaType::Int) { + if (QMetaType::Type(arguments.at(i).userType()) != QMetaType::Int) { qCWarning(lcTuioHandler) << "Ignoring malformed TUIO alive message (bad argument on position" << i << arguments << ')'; return; } @@ -293,12 +293,12 @@ void QTuioHandler::process2DCurSet(const QOscMessage &message) return; } - if (QMetaType::Type(arguments.at(1).type()) != QMetaType::Int || - QMetaType::Type(arguments.at(2).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(3).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(4).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(5).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(6).type()) != QMetaType::Float + if (QMetaType::Type(arguments.at(1).userType()) != QMetaType::Int || + QMetaType::Type(arguments.at(2).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(3).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(4).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(5).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(6).userType()) != QMetaType::Float ) { qCWarning(lcTuioSet) << "Ignoring malformed TUIO set message with bad types: " << arguments; return; @@ -391,7 +391,7 @@ void QTuioHandler::process2DObjSource(const QOscMessage &message) return; } - if (QMetaType::Type(arguments.at(1).type()) != QMetaType::QByteArray) { + if (QMetaType::Type(arguments.at(1).userType()) != QMetaType::QByteArray) { qCWarning(lcTuioSource, "Ignoring malformed TUIO source message (bad argument type)"); return; } @@ -413,7 +413,7 @@ void QTuioHandler::process2DObjAlive(const QOscMessage &message) QMap<int, QTuioToken> newActiveTokens; for (int i = 1; i < arguments.count(); ++i) { - if (QMetaType::Type(arguments.at(i).type()) != QMetaType::Int) { + if (QMetaType::Type(arguments.at(i).userType()) != QMetaType::Int) { qCWarning(lcTuioHandler) << "Ignoring malformed TUIO alive message (bad argument on position" << i << arguments << ')'; return; } @@ -458,16 +458,16 @@ void QTuioHandler::process2DObjSet(const QOscMessage &message) return; } - if (QMetaType::Type(arguments.at(1).type()) != QMetaType::Int || - QMetaType::Type(arguments.at(2).type()) != QMetaType::Int || - QMetaType::Type(arguments.at(3).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(4).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(5).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(6).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(7).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(8).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(9).type()) != QMetaType::Float || - QMetaType::Type(arguments.at(10).type()) != QMetaType::Float) { + if (QMetaType::Type(arguments.at(1).userType()) != QMetaType::Int || + QMetaType::Type(arguments.at(2).userType()) != QMetaType::Int || + QMetaType::Type(arguments.at(3).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(4).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(5).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(6).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(7).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(8).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(9).userType()) != QMetaType::Float || + QMetaType::Type(arguments.at(10).userType()) != QMetaType::Float) { qCWarning(lcTuioSet) << "Ignoring malformed TUIO set message with bad types: " << arguments; return; } |