aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2012-04-24 12:03:51 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-24 13:00:28 +0200
commit826a5390a13991e9ef2c2f11366c4ab55480594f (patch)
tree66ad60ca6e5565c743be994feb1c3fab7274c13c
parentdf25dcaaa75e7ef0da30d4b94ac53c77262f1096 (diff)
Initialize value type properties.
This patch ensures that the value type properties (e.g. QColor) are initialized before updating their values. Change-Id: I789fe8247e0ded17460570ab28b8834aa22f0a40 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index d1632820a0..b39ca34739 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -645,6 +645,8 @@ int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
writeProperty(id, *reinterpret_cast<QVariant *>(a[0]));
break;
default:
+ if (! data[id].dataType())
+ QQml_valueTypeProvider()->initValueType(t, data[id].dataPtr(), data[id].dataSize());
needActivate = QQml_valueTypeProvider()->writeValueType(t, a[0], data[id].dataPtr(), data[id].dataSize());
if (needActivate) {
data[id].setDataType(t);