aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-06-01 12:54:23 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-06-08 22:37:35 +0200
commit062843124470e90ada7323b0734ff35addb0a9cb (patch)
treebdc29b0ff44a03abf3b4e55f5b17f9def7d18d13 /src/qml/jsruntime/qv4engine.cpp
parent9136e5748b72e68613d7c3644a739dba36cdea34 (diff)
Qml: Construct value types by properties from any object-likes
Since we allow any object to be used for property-by-property construction when encoded as QJSValue, we should do the same when it's encoded as QVariant. This allows us to use typed modelData in delegates. The modelData's type only has to be a structured value. Any matching data from the model will then be inserted. Fixes: QTBUG-113752 Pick-to: 6.5 6.6 Change-Id: I200e9acac3c6c302c9dedf8e7e1ccd6c9fdf5eb6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 9a56ad9d88..adf133f048 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -2736,7 +2736,7 @@ bool ExecutionEngine::metaTypeFromJS(const Value &value, QMetaType metaType, voi
*reinterpret_cast<QJSPrimitiveValue *>(data) = createPrimitive(&value);
return true;
} else if (!isPointer) {
- if (QQmlValueTypeProvider::createValueType(value, metaType, data))
+ if (QQmlValueTypeProvider::createValueType(metaType, data, value))
return true;
}