aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-11-22 13:43:10 +0000
committerQt by Nokia <qt-info@nokia.com>2011-11-22 14:45:14 +0100
commit0ce1d0c0e41dab04b2267fed1fe20b70884765a4 (patch)
tree7b1567259fa8853c93d4ab88c8d38964434b6304 /tests
parent8c7da024f0b8743c7e2ffd45e918bdc3e79d200a (diff)
Don't disconnect mid binding evaluation
Task-number: QTBUG-22816 Change-Id: I7a958203945a051322228b6fade9e1d49d5f4c4a Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/v4/data/qtbug_22816.qml18
-rw-r--r--tests/auto/declarative/v4/tst_v4.cpp12
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/declarative/v4/data/qtbug_22816.qml b/tests/auto/declarative/v4/data/qtbug_22816.qml
new file mode 100644
index 0000000000..bfa8d4948c
--- /dev/null
+++ b/tests/auto/declarative/v4/data/qtbug_22816.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+
+Item {
+ QtObject {
+ id: object
+ property bool prop1: true
+ function myfunction() { return true; }
+ property bool prop2: object.prop1 && myfunction();
+ }
+
+ property bool test1: object.prop1 && object.prop2
+ property bool test2: object.prop1
+
+ Component.onCompleted: {
+ object.prop1 = false;
+ }
+}
+
diff --git a/tests/auto/declarative/v4/tst_v4.cpp b/tests/auto/declarative/v4/tst_v4.cpp
index 20d739f4b5..69fa4bbf0c 100644
--- a/tests/auto/declarative/v4/tst_v4.cpp
+++ b/tests/auto/declarative/v4/tst_v4.cpp
@@ -78,6 +78,7 @@ private slots:
void nestedObjectAccess();
void subscriptionsInConditionalExpressions();
void qtbug_21883();
+ void qtbug_22816();
private:
QDeclarativeEngine engine;
@@ -253,6 +254,17 @@ void tst_v4::qtbug_21883()
delete o;
}
+void tst_v4::qtbug_22816()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_22816.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test1").toBool(), false);
+ QCOMPARE(o->property("test2").toBool(), false);
+ delete o;
+}
+
QTEST_MAIN(tst_v4)
#include "tst_v4.moc"