diff options
author | Juha Vuolle <juha.vuolle@insta.fi> | 2020-12-16 13:19:14 +0200 |
---|---|---|
committer | Juha Vuolle <juha.vuolle@insta.fi> | 2021-01-05 14:08:38 +0200 |
commit | 32ff708d5d037400552b862bf29853adc97e6a6e (patch) | |
tree | cc803b60957dc5979dad9b9350438083f9737d80 /tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp | |
parent | ba55dd919da18cc4e7c5905b40f7a51e6a4789d4 (diff) |
Remove deprecation warnings due to QVariant::type() usage
Additionally use typeId() directly instead of userType() as they do
the same thing.
Change-Id: Icae3a05421e1ccfe4de9e32bbb5fc51925d75cfb
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp')
-rw-r--r-- | tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp index 94a065bc..d177edcc 100644 --- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp +++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp @@ -182,17 +182,17 @@ static void dumpAttributeVariant(const QVariant &var, const QString indent) return; } - if (var.userType() == qMetaTypeId<QBluetoothServiceInfo::Sequence>()) { + if (var.typeId() == qMetaTypeId<QBluetoothServiceInfo::Sequence>()) { qDebug("%sSequence", indent.toLocal8Bit().constData()); const QBluetoothServiceInfo::Sequence *sequence = static_cast<const QBluetoothServiceInfo::Sequence *>(var.data()); for (const QVariant &v : *sequence) dumpAttributeVariant(v, indent + '\t'); - } else if (var.userType() == qMetaTypeId<QBluetoothServiceInfo::Alternative>()) { + } else if (var.typeId() == qMetaTypeId<QBluetoothServiceInfo::Alternative>()) { qDebug("%sAlternative", indent.toLocal8Bit().constData()); const QBluetoothServiceInfo::Alternative *alternative = static_cast<const QBluetoothServiceInfo::Alternative *>(var.data()); for (const QVariant &v : *alternative) dumpAttributeVariant(v, indent + '\t'); - } else if (var.userType() == qMetaTypeId<QBluetoothUuid>()) { + } else if (var.typeId() == qMetaTypeId<QBluetoothUuid>()) { QBluetoothUuid uuid = var.value<QBluetoothUuid>(); switch (uuid.minimumSize()) { case 0: @@ -212,20 +212,20 @@ static void dumpAttributeVariant(const QVariant &var, const QString indent) qDebug("%suuid ???", indent.toLocal8Bit().constData()); } } else { - switch (var.userType()) { - case QVariant::UInt: + switch (var.typeId()) { + case QMetaType::UInt: qDebug("%suint %u", indent.toLocal8Bit().constData(), var.toUInt()); break; - case QVariant::Int: + case QMetaType::Int: qDebug("%sint %d", indent.toLocal8Bit().constData(), var.toInt()); break; - case QVariant::String: + case QMetaType::QString: qDebug("%sstring %s", indent.toLocal8Bit().constData(), var.toString().toLocal8Bit().constData()); break; - case QVariant::Bool: + case QMetaType::Bool: qDebug("%sbool %d", indent.toLocal8Bit().constData(), var.toBool()); break; - case QVariant::Url: + case QMetaType::QUrl: qDebug("%surl %s", indent.toLocal8Bit().constData(), var.toUrl().toString().toLocal8Bit().constData()); break; default: |