summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-17 23:13:06 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-17 23:13:06 (GMT)
commitfb598e47babddb25055ee8a8c5c9da0013e81859 (patch)
tree4bd5e64aad471b9bf4bcc62973f71fc0f645964a
parent67b89083b2d8667a89276488968873585790b868 (diff)
parent412920402f488c2cf6eb81e7582f9b5aa7b06680 (diff)
downloadQt-fb598e47babddb25055ee8a8c5c9da0013e81859.zip
Qt-fb598e47babddb25055ee8a8c5c9da0013e81859.tar.gz
Qt-fb598e47babddb25055ee8a8c5c9da0013e81859.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--src/declarative/qml/qmlobjectscriptclass.cpp4
-rw-r--r--tests/auto/declarative/qmlecmascript/data/CustomObject.qml5
-rw-r--r--tests/auto/declarative/qmlecmascript/data/compositePropertyType.qml8
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp9
4 files changed, 25 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp
index 30d4422..4488ba1 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qmlobjectscriptclass.cpp
@@ -302,7 +302,9 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
// ### Can well known types be optimized?
QVariant v = QmlScriptClass::toVariant(engine, value);
- delete QmlMetaPropertyPrivate::setBinding(obj, *lastData, 0);
+ QmlAbstractBinding *delBinding = QmlMetaPropertyPrivate::setBinding(obj, *lastData, 0);
+ if (delBinding)
+ delBinding->destroy();
QmlMetaPropertyPrivate::write(obj, *lastData, v, evalContext);
}
diff --git a/tests/auto/declarative/qmlecmascript/data/CustomObject.qml b/tests/auto/declarative/qmlecmascript/data/CustomObject.qml
new file mode 100644
index 0000000..691d9ec
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/CustomObject.qml
@@ -0,0 +1,5 @@
+import Qt 4.6
+
+QtObject {
+ property string greeting: "hello world"
+}
diff --git a/tests/auto/declarative/qmlecmascript/data/compositePropertyType.qml b/tests/auto/declarative/qmlecmascript/data/compositePropertyType.qml
new file mode 100644
index 0000000..80a2814
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/compositePropertyType.qml
@@ -0,0 +1,8 @@
+import Qt 4.6
+
+QtObject {
+ property CustomObject myObject
+ myObject: CustomObject { }
+
+ Component.onCompleted: console.log(myObject.greeting)
+}
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index b9a2241..f0e54ef 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -110,6 +110,7 @@ private slots:
void transientErrors();
void shutdownErrors();
void externalScript();
+ void compositePropertyType();
void bug1();
@@ -1017,6 +1018,14 @@ void tst_qmlecmascript::externalScript()
}
}
+void tst_qmlecmascript::compositePropertyType()
+{
+ QmlComponent component(&engine, TEST_FILE("compositePropertyType.qml"));
+ QTest::ignoreMessage(QtDebugMsg, "hello world");
+ QObject *object = qobject_cast<QObject *>(component.create());
+ delete object;
+}
+
void tst_qmlecmascript::bug1()
{
QmlComponent component(&engine, TEST_FILE("bug.1.qml"));