aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-10-05 17:02:03 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-10-19 20:32:01 +0200
commita824a6f060ec3a0000d7349649a3ab9e0570ecaa (patch)
tree9574d4f96d52bf0de792bab52d42bd35a08027e6 /src/qml/jsruntime/qv4engine_p.h
parente89a06753c772bd96b3299e03b2f7ad78ffc9fb9 (diff)
Recursively write back value types and sequences
Both types have functionality to write themselves back to the properties they were loaded from on change, but so far we could not nest those writes. [ChangeLog][QtQml] You can now assign to properties of nested value types and to elements of containers from QML functions. You cannot, however, take references of such values and elements. This is in contrast to non-nested value types and the containers themselves. However, passing references of value types and containers around generally leads to very confusing effects. Don't do this. Fixes: QTBUG-99766 Change-Id: I74cb89e5c3d733b0b61e42969d617b2ecc1562f4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r--src/qml/jsruntime/qv4engine_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 06c6f5eeff..d1633abf52 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -641,6 +641,8 @@ public:
static QVariant toVariant(
const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjects = true);
QV4::ReturnedValue fromVariant(const QVariant &);
+ QV4::ReturnedValue fromVariant(
+ const QVariant &variant, Heap::Object *parent, int property, uint flags);
static QVariantMap variantMapFromJS(const QV4::Object *o);
@@ -739,7 +741,9 @@ public:
QV4::ExecutionContext *ctxt, int argc, const QV4::Value *argv);
private:
- QV4::ReturnedValue fromData(QMetaType type, const void *ptr);
+ QV4::ReturnedValue fromData(
+ QMetaType type, const void *ptr,
+ Heap::Object *parent = nullptr, int property = -1, uint flags = 0);
static void initializeStaticMembers();
static int s_maxCallDepth;