diff options
author | David Skoland <david.skoland@qt.io> | 2020-10-27 10:49:29 +0100 |
---|---|---|
committer | David Skoland <david.skoland@qt.io> | 2020-10-30 22:18:21 +0100 |
commit | b379e880a9d441d9b67c47474d20b3e09b72b9e3 (patch) | |
tree | c93c5da3fdef2b92a4f8afe94dd65caaad2afc99 | |
parent | 02f429f06c2fea0fbf4ec0f3fd45f5c3418c5c9d (diff) |
Update tst_qcborstreamwriter to use QMetaType
Since the QVariant types are deprecated in Qt6, use QMetaType instead
Change-Id: I7bddea15a3f1a534d3c6f6b9e7ddf9585a8423bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp b/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp index 6995b4d08b..40e9291a13 100644 --- a/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp +++ b/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp @@ -69,33 +69,33 @@ void encodeVariant(QCborStreamWriter &writer, const QVariant &v) { int type = v.userType(); switch (type) { - case QVariant::Int: - case QVariant::LongLong: + case QMetaType::Int: + case QMetaType::LongLong: return writer.append(v.toLongLong()); - case QVariant::UInt: - case QVariant::ULongLong: + case QMetaType::UInt: + case QMetaType::ULongLong: return writer.append(v.toULongLong()); - case QVariant::Bool: + case QMetaType::Bool: return writer.append(v.toBool()); - case QVariant::Invalid: + case QMetaType::UnknownType: return writer.appendUndefined(); case QMetaType::VoidStar: return writer.append(nullptr); - case QVariant::Double: + case QMetaType::Double: return writer.append(v.toDouble()); case QMetaType::Float: return writer.append(v.toFloat()); - case QVariant::String: + case QMetaType::QString: return writer.append(v.toString()); - case QVariant::ByteArray: + case QMetaType::QByteArray: return writer.append(v.toByteArray()); default: @@ -109,7 +109,7 @@ void encodeVariant(QCborStreamWriter &writer, const QVariant &v) writer.append(QCborTag(v.value<Tag>().tag)); return encodeVariant(writer, v.value<Tag>().tagged); } - if (type == QVariant::List || type == qMetaTypeId<IndeterminateLengthArray>()) { + if (type == QMetaType::QVariantList || type == qMetaTypeId<IndeterminateLengthArray>()) { QVariantList list = v.toList(); if (type == qMetaTypeId<IndeterminateLengthArray>()) { list = v.value<IndeterminateLengthArray>(); |