diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-07 11:52:55 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-07 21:15:57 +0200 |
commit | 07ab2d0b18f3ee9b05c7968364c1512641cf04fd (patch) | |
tree | 4e7c765fda60015a5d83a6aa8bb196e1e6c0d038 /tools/testcon | |
parent | 15744be7b78e300dc92c06c37b59dbbb5a12f915 (diff) |
Fix QMetaType/QVariant-related deprecations
- Refactor code to use ints for metatype id
Change-Id: I0a88f19ade25b1f8bb5a5138c602a71cf1f7282a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tools/testcon')
-rw-r--r-- | tools/testcon/changeproperties.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/testcon/changeproperties.cpp b/tools/testcon/changeproperties.cpp index 966b5f1..40de875 100644 --- a/tools/testcon/changeproperties.cpp +++ b/tools/testcon/changeproperties.cpp @@ -87,14 +87,14 @@ void ChangeProperties::on_buttonSet_clicked() QString prop = item->text(0); QVariant value = activex->property(prop.toLatin1()); - QVariant::Type type = value.type(); + int type = value.type(); if (!value.isValid()) { const QMetaObject *mo = activex->metaObject(); const QMetaProperty property = mo->property(mo->indexOfProperty(prop.toLatin1())); - type = QVariant::nameToType(property.typeName()); + type = QMetaType::fromName(property.typeName()).id(); } switch (type) { - case QVariant::Color: + case QMetaType::QColor: { QColor col; col.setNamedColor(editValue->text()); @@ -109,7 +109,7 @@ void ChangeProperties::on_buttonSet_clicked() } } break; - case QVariant::Font: + case QMetaType::QFont: { QFont fnt; if (fnt.fromString(editValue->text())) { @@ -123,7 +123,7 @@ void ChangeProperties::on_buttonSet_clicked() } } break; - case QVariant::Pixmap: + case QMetaType::QPixmap: { QString fileName = editValue->text(); if (fileName.isEmpty()) @@ -135,13 +135,13 @@ void ChangeProperties::on_buttonSet_clicked() value = QVariant::fromValue(pm); } break; - case QVariant::Bool: + case QMetaType::Bool: { const QString txt = editValue->text(); value = QVariant(txt != QLatin1String("0") && txt.compare(QLatin1String("false"), Qt::CaseInsensitive)); } break; - case QVariant::List: + case QMetaType::QVariantList: { QStringList txtList = editValue->text().split(QRegularExpression(QLatin1String("[,;]"))); QVariantList varList; |