aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/qml/qqmlpropertybinding.cpp6
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.h4
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlpropertybinding.cpp b/src/qml/qml/qqmlpropertybinding.cpp
index c8442cf510..acd5978961 100644
--- a/src/qml/qml/qqmlpropertybinding.cpp
+++ b/src/qml/qml/qqmlpropertybinding.cpp
@@ -108,8 +108,10 @@ QUntypedPropertyBinding::BindingEvaluationResult QQmlPropertyBinding::evaluate(c
}
QVariant resultVariant(scope.engine->toVariant(result, metaType.id()));
- QMetaType::destruct(metaType.id(), dataPtr);
- QMetaType::construct(metaType.id(), dataPtr, resultVariant.constData());
+ auto metaTypeId= metaType.id();
+ resultVariant.convert(metaTypeId);
+ QMetaType::destruct(metaTypeId, dataPtr);
+ QMetaType::construct(metaTypeId, dataPtr, resultVariant.constData());
return QPropertyBindingError::NoError;
}
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h
index 0d92288148..0a0fb98eb5 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.h
+++ b/tests/auto/qml/qqmlecmascript/testtypes.h
@@ -1727,9 +1727,9 @@ public:
struct ClassWithQProperty : public QObject
{
Q_OBJECT
- Q_PROPERTY(int value)
+ Q_PROPERTY(float value)
public:
- QProperty<int> value;
+ QProperty<float> value;
};
void registerTypes();
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index ce66a2fe82..2e43642ecd 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -9285,7 +9285,7 @@ void tst_qqmlecmascript::bindingOnQProperty()
QCOMPARE(test->property("changeHandlerCount").toInt(), 1);
QVERIFY(qobject_cast<ClassWithQProperty*>(test.data()));
- QProperty<int> &qprop = static_cast<ClassWithQProperty*>(test.data())->value;
+ QProperty<float> &qprop = static_cast<ClassWithQProperty*>(test.data())->value;
QVERIFY(qprop.hasBinding());
}