aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-10-03 19:11:56 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-10-07 19:00:06 +0200
commitbb698b7f2e974a23b688dd15393f6a550448a5a8 (patch)
tree98d8c85a1b4311ddd27a2065d7da8bf3dd80f145 /src/qml/jsruntime/qv4engine.cpp
parent3f8861dc42d20e8c67fe60dd6ea34dbe57aeb4fc (diff)
QtQml: Correctly convert to QQmlListProperty<QObject>
If we have a QQmlListWrapper, we can extract its property. Fixes: QTBUG-117829 Pick-to: 6.6 6.5 6.2 Change-Id: I46ae8db1aabf7c1b617a22f371ce4f060cf4bb38 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index adbac53544..c0a0c0e534 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -2651,6 +2651,13 @@ bool ExecutionEngine::metaTypeFromJS(const Value &value, QMetaType metaType, voi
}
}
+ if (metaType == QMetaType::fromType<QQmlListProperty<QObject>>()) {
+ if (const QV4::QmlListWrapper *wrapper = value.as<QV4::QmlListWrapper>()) {
+ *reinterpret_cast<QQmlListProperty<QObject> *>(data) = *wrapper->d()->property();
+ return true;
+ }
+ }
+
if (const QQmlValueTypeWrapper *vtw = value.as<QQmlValueTypeWrapper>()) {
const QMetaType valueType = vtw->type();
if (valueType == metaType)