From 73d1476fb1397948a4d806bd921fce372bd8d63b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 2 Dec 2019 17:54:48 +0100 Subject: 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 --- src/dbus/qdbusmetaobject.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/dbus/qdbusmetaobject.cpp') diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index 3c529ab755..5265568f42 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -158,10 +158,10 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, const char *direction, int id) { Type result; - result.id = QVariant::Invalid; + result.id = QMetaType::UnknownType; int type = QDBusMetaType::signatureToType(signature); - if (type == QVariant::Invalid && !qt_dbus_metaobject_skip_annotations) { + if (type == QMetaType::UnknownType && !qt_dbus_metaobject_skip_annotations) { // it's not a type normally handled by our meta type system // it must contain an annotation QString annotationName = QString::fromLatin1("org.qtproject.QtDBus.QtTypeName"); @@ -189,7 +189,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, type = QMetaType::type(typeName); } - if (type == QVariant::Invalid || signature != QDBusMetaType::typeToSignature(type)) { + if (type == QMetaType::UnknownType || signature != QDBusMetaType::typeToSignature(type)) { // type is still unknown or doesn't match back to the signature that it // was expected to, so synthesize a fake type typeName = "QDBusRawType<0x" + signature.toHex() + ">*"; @@ -197,16 +197,16 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, } result.name = typeName; - } else if (type == QVariant::Invalid) { + } else if (type == QMetaType::UnknownType) { // this case is used only by the qdbus command-line tool // invalid, let's create an impossible type that contains the signature if (signature == "av") { result.name = "QVariantList"; - type = QVariant::List; + type = QMetaType::QVariantList; } else if (signature == "a{sv}") { result.name = "QVariantMap"; - type = QVariant::Map; + type = QMetaType::QVariantMap; } else if (signature == "a{ss}") { result.name = "QMap"; type = qMetaTypeId >(); @@ -246,7 +246,7 @@ void QDBusMetaObjectGenerator::parseMethods() const QDBusIntrospection::Argument &arg = m.inputArgs.at(i); Type type = findType(arg.type.toLatin1(), m.annotations, "In", i); - if (type.id == QVariant::Invalid) { + if (type.id == QMetaType::UnknownType) { ok = false; break; } @@ -265,7 +265,7 @@ void QDBusMetaObjectGenerator::parseMethods() const QDBusIntrospection::Argument &arg = m.outputArgs.at(i); Type type = findType(arg.type.toLatin1(), m.annotations, "Out", i); - if (type.id == QVariant::Invalid) { + if (type.id == QMetaType::UnknownType) { ok = false; break; } @@ -322,7 +322,7 @@ void QDBusMetaObjectGenerator::parseSignals() const QDBusIntrospection::Argument &arg = s.outputArgs.at(i); Type type = findType(arg.type.toLatin1(), s.annotations, "Out", i); - if (type.id == QVariant::Invalid) { + if (type.id == QMetaType::UnknownType) { ok = false; break; } @@ -358,7 +358,7 @@ void QDBusMetaObjectGenerator::parseProperties() const QDBusIntrospection::Property &p = *prop_it; Property mp; Type type = findType(p.type.toLatin1(), p.annotations); - if (type.id == QVariant::Invalid) + if (type.id == QMetaType::UnknownType) continue; QByteArray name = p.name.toLatin1(); -- cgit v1.2.3