aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertybinding.cpp
diff options
context:
space:
mode:
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;
};