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/dbus/qdbusmarshaller.cpp | |
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/dbus/qdbusmarshaller.cpp')
-rw-r--r-- | src/dbus/qdbusmarshaller.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dbus/qdbusmarshaller.cpp b/src/dbus/qdbusmarshaller.cpp index 46b41d1c07..c80131f41d 100644 --- a/src/dbus/qdbusmarshaller.cpp +++ b/src/dbus/qdbusmarshaller.cpp @@ -190,7 +190,7 @@ inline bool QDBusMarshaller::append(const QDBusVariant &arg) const QVariant &value = arg.variant(); int id = value.userType(); - if (id == QVariant::Invalid) { + if (id == QMetaType::UnknownType) { qWarning("QDBusMarshaller: cannot add a null QDBusVariant"); error(QLatin1String("Variant containing QVariant::Invalid passed in arguments")); return false; @@ -384,7 +384,7 @@ void QDBusMarshaller::error(const QString &msg) bool QDBusMarshaller::appendVariantInternal(const QVariant &arg) { int id = arg.userType(); - if (id == QVariant::Invalid) { + if (id == QMetaType::UnknownType) { qWarning("QDBusMarshaller: cannot add an invalid QVariant"); error(QLatin1String("Variant containing QVariant::Invalid passed in arguments")); return false; @@ -485,12 +485,12 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg) case DBUS_TYPE_ARRAY: // could be many things // find out what kind of array it is - switch (arg.type()) { - case QVariant::StringList: + switch (arg.userType()) { + case QMetaType::QStringList: append( arg.toStringList() ); return true; - case QVariant::ByteArray: + case QMetaType::QByteArray: append( arg.toByteArray() ); return true; |