OSDN Git Service

QmlPuppet: crashfix for puppet
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Fri, 18 Mar 2011 15:56:55 +0000 (16:56 +0100)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Fri, 18 Mar 2011 16:32:12 +0000 (17:32 +0100)
We have to set a value when creating a dynamic property.
Otherwise the metacall triggered latter might crash when trying
to compare old and new value.
Task-number: QTCREATORBUG-4088

src/plugins/qmldesigner/designercore/instances/nodeinstancemetaobject.cpp

index 2624080..7ff03ba 100644 (file)
@@ -61,6 +61,7 @@ NodeInstanceMetaObject::NodeInstanceMetaObject(const ObjectNodeInstancePointer &
 void NodeInstanceMetaObject::createNewProperty(const QString &name)
 {
     int id = createProperty(name.toLatin1(), 0);
+    setValue(id, QVariant());
     Q_ASSERT(id >= 0);
     Q_UNUSED(id)
 }