aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertybinding.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-09-08 12:33:23 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-09-16 08:36:58 +0200
commit0b92a93e8e165520b12cb8ca1d0a8812ed6e046b (patch)
treeabd70e7ce9477a31578d85d499ba69052d2befc5 /src/qml/qml/qqmlpropertybinding.cpp
parent7dab889190b2289a7c4b48e732d7cb7838dbf297 (diff)
Avoid various warnings about deprected QMetaType methods
Change-Id: I8f4b2703fdd08ff341904219cec33c321e0511c7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertybinding.cpp')
-rw-r--r--src/qml/qml/qqmlpropertybinding.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlpropertybinding.cpp b/src/qml/qml/qqmlpropertybinding.cpp
index a528cf2754..b691bf39a9 100644
--- a/src/qml/qml/qqmlpropertybinding.cpp
+++ b/src/qml/qml/qqmlpropertybinding.cpp
@@ -123,11 +123,10 @@ bool QQmlPropertyBinding::evaluate(const QMetaType &metaType, void *dataPtr)
}
QVariant resultVariant(scope.engine->toVariant(result, metaType.id()));
- auto metaTypeId = metaType.id();
- resultVariant.convert(metaTypeId);
+ resultVariant.convert(metaType);
const bool hasChanged = !metaType.equals(resultVariant.constData(), dataPtr);
- QMetaType::destruct(metaTypeId, dataPtr);
- QMetaType::construct(metaTypeId, dataPtr, resultVariant.constData());
+ metaType.destruct(dataPtr);
+ metaType.construct(dataPtr, resultVariant.constData());
return hasChanged;
}
@@ -139,11 +138,11 @@ QUntypedPropertyBinding QQmlTranslationPropertyBinding::create(const QQmlPropert
QVariant resultVariant(compilationUnit->bindingValueAsString(binding));
if (metaType.id() != QMetaType::QString)
- resultVariant.convert(metaType.id());
+ resultVariant.convert(metaType);
const bool hasChanged = !metaType.equals(resultVariant.constData(), dataPtr);
- QMetaType::destruct(metaType.id(), dataPtr);
- QMetaType::construct(metaType.id(), dataPtr, resultVariant.constData());
+ metaType.destruct(dataPtr);
+ metaType.construct(dataPtr, resultVariant.constData());
return hasChanged;
};