diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-14 09:50:23 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-14 09:50:24 +0100 |
commit | 1619b7d207f7a84810e4790766ac33a3ac9aaa1a (patch) | |
tree | add23ef6ddf9f28157e65db17b04a81f9b22e87e /src/qml/qml/qqmlvmemetaobject_p.h | |
parent | 554309a1c1127b4a614cdba4f9ece46fc85df7e1 (diff) | |
parent | c89f7a221b7c31a0a4e1b0eed2e91d7633f4eab2 (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: I06578422b4558feabf7a77426b01e77953ab60e2
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject_p.h')
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject_p.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h index 5025987586..58332ff7a8 100644 --- a/src/qml/qml/qqmlvmemetaobject_p.h +++ b/src/qml/qml/qqmlvmemetaobject_p.h @@ -194,12 +194,18 @@ public: void writeProperty(int id, bool v); void writeProperty(int id, double v); void writeProperty(int id, const QString& v); - void writeProperty(int id, const QPointF& v); - void writeProperty(int id, const QSizeF& v); - void writeProperty(int id, const QUrl& v); - void writeProperty(int id, const QDate& v); - void writeProperty(int id, const QDateTime& v); - void writeProperty(int id, const QRectF& v); + + template<typename VariantCompatible> + void writeProperty(int id, const VariantCompatible &v) + { + QV4::MemberData *md = propertyAndMethodStorageAsMemberData(); + if (md) { + QV4::Scope scope(engine); + QV4::Scoped<QV4::MemberData>(scope, md)->set(engine, id, engine->newVariantObject( + QVariant::fromValue(v))); + } + } + void writeProperty(int id, QObject *v); void ensureQObjectWrapper(); |