aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-07-25 13:06:28 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-25 06:08:56 +0200
commit9cb3889b33a4a92db40a3a72c3ee4fa25770d539 (patch)
tree01b25e5a091a4a7874e6e300a42fd3cd40ee9f8f /tests
parente826e578eaef3f05498124eb2057f41410696480 (diff)
Correctly load flags for binding properties
Change-Id: I80e79ff7de8d879f700f9f4fe96d796de0f17aff Reviewed-on: http://codereview.qt.nokia.com/2055 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ElementAssignType.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/elementAssign.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp15
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ElementAssignType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ElementAssignType.qml
new file mode 100644
index 0000000000..4127ca4375
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ElementAssignType.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int value
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/elementAssign.qml b/tests/auto/declarative/qdeclarativeecmascript/data/elementAssign.qml
new file mode 100644
index 0000000000..61854df71c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/elementAssign.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property bool test: bound.value == 1923
+
+ property ElementAssignType element: ElementAssignType { value: 1923 }
+ property ElementAssignType bound: root.element
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 22c2096ea4..1f6427b06e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -148,6 +148,7 @@ private slots:
void importScripts();
void scarceResources();
void propertyChangeSlots();
+ void elementAssign();
void bug1();
void bug2();
@@ -189,6 +190,7 @@ private slots:
void revisionErrors();
void revision();
+
private:
QDeclarativeEngine engine;
};
@@ -2909,6 +2911,19 @@ void tst_qdeclarativeecmascript::propertyChangeSlots()
delete object;
}
+// Ensure that QObject type conversion works on binding assignment
+void tst_qdeclarativeecmascript::elementAssign()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("elementAssign.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
// Test that assigning a null object works
// Regressed with: df1788b4dbbb2826ae63f26bdf166342595343f4
void tst_qdeclarativeecmascript::nullObjectBinding()