aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqml.cpp')
-rw-r--r--src/qml/qml/qqml.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp
index b9f31ba2d5..434e025890 100644
--- a/src/qml/qml/qqml.cpp
+++ b/src/qml/qml/qqml.cpp
@@ -941,8 +941,19 @@ void AOTCompiledContext::storeNameSloppy(uint nameIndex, void *value, QMetaType
QV4::Lookup l;
l.clear();
l.nameIndex = nameIndex;
- if (initObjectLookup(this, &l, qmlScopeObject, type)) {
- switch (storeObjectProperty(&l, qmlScopeObject, value)) {
+ if (initObjectLookup(this, &l, qmlScopeObject, QMetaType())) {
+
+ ObjectPropertyResult storeResult;
+ const QMetaType propType = l.qobjectLookup.propertyData->propType();
+ if (type == propType) {
+ storeResult = storeObjectProperty(&l, qmlScopeObject, value);
+ } else {
+ QVariant var(propType);
+ propType.convert(type, value, propType, var.data());
+ storeResult = storeObjectProperty(&l, qmlScopeObject, var.data());
+ }
+
+ switch (storeResult) {
case ObjectPropertyResult::NeedsInit:
engine->handle()->throwTypeError();
break;