From 11bad6109606794091adc3b8a14070ac09707f45 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 10 Sep 2020 17:05:10 +0200 Subject: Deprecate QVariant::Type It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale --- src/corelib/serialization/qjsoncbor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/serialization/qjsoncbor.cpp') diff --git a/src/corelib/serialization/qjsoncbor.cpp b/src/corelib/serialization/qjsoncbor.cpp index 5d6f521d1b..6256028c3a 100644 --- a/src/corelib/serialization/qjsoncbor.cpp +++ b/src/corelib/serialization/qjsoncbor.cpp @@ -662,7 +662,7 @@ static void appendVariant(QCborContainerPrivate *d, const QVariant &variant) { // Handle strings and byte arrays directly, to avoid creating a temporary // dummy container to hold their data. - int type = variant.userType(); + int type = variant.metaType().id(); if (type == QMetaType::QString) { d->append(variant.toString()); } else if (type == QMetaType::QByteArray) { @@ -728,7 +728,7 @@ static void appendVariant(QCborContainerPrivate *d, const QVariant &variant) */ QCborValue QCborValue::fromVariant(const QVariant &variant) { - switch (variant.userType()) { + switch (variant.metaType().id()) { case QMetaType::UnknownType: return {}; case QMetaType::Nullptr: -- cgit v1.2.3