diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-30 13:19:45 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-30 17:37:43 +0100 |
commit | 8d7b49e91e85077f285e468f149270d4b13df041 (patch) | |
tree | a2f52f92da926c445371a3d5d5966c3c46a9ac5a /tools/testcon | |
parent | a223a1434e4dd06581650f53631b84ed169e7dcc (diff) |
Fix warnings about deprecated QVariant::Type
Change-Id: I377e524edaf686d1a77e24f3dcb8f94476004b43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tools/testcon')
-rw-r--r-- | tools/testcon/changeproperties.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/testcon/changeproperties.cpp b/tools/testcon/changeproperties.cpp index 40de875..ca609bd 100644 --- a/tools/testcon/changeproperties.cpp +++ b/tools/testcon/changeproperties.cpp @@ -87,7 +87,7 @@ void ChangeProperties::on_buttonSet_clicked() QString prop = item->text(0); QVariant value = activex->property(prop.toLatin1()); - int type = value.type(); + int type = value.metaType().id(); if (!value.isValid()) { const QMetaObject *mo = activex->metaObject(); const QMetaProperty property = mo->property(mo->indexOfProperty(prop.toLatin1())); @@ -208,31 +208,31 @@ void ChangeProperties::updateProperties() } QVariant var = activex->property(property.name()); - switch (var.type()) { - case QVariant::Color: + switch (var.metaType().id()) { + case QMetaType::QColor: { QColor col = qvariant_cast<QColor>(var); item->setText(2, col.name()); } break; - case QVariant::Font: + case QMetaType::QFont: { QFont fnt = qvariant_cast<QFont>(var); item->setText(2, fnt.toString()); } break; - case QVariant::Bool: + case QMetaType::Bool: { item->setText(2, var.toBool() ? QLatin1String("true") : QLatin1String("false")); } break; - case QVariant::Pixmap: + case QMetaType::QPixmap: { QPixmap pm = qvariant_cast<QPixmap>(var); item->setIcon(2, pm); } break; - case QVariant::List: + case QMetaType::QVariantList: { const auto varList = var.toList(); QStringList strList; @@ -241,7 +241,7 @@ void ChangeProperties::updateProperties() item->setText(2, strList.join(QLatin1String(", "))); } break; - case QVariant::Int: + case QMetaType::Int: if (property.isEnumType()) { const QMetaEnum enumerator = mo->enumerator(mo->indexOfEnumerator(property.typeName())); item->setText(2, QString::fromLatin1(enumerator.valueToKey(var.toInt()))); |