Task-number: QTBUG-22816
Change-Id: I7a958203945a051322228b6fade9e1d49d5f4c4a
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
void QV4Bindings::subscribe(QObject *o, int notifyIndex, int subIndex)
{
Subscription *sub = (subscriptions + subIndex);
+ if (sub->isConnected(o, notifyIndex))
+ return;
sub->bindings = this;
sub->method = subIndex;
if (o)
--- /dev/null
+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;
+ }
+}
+
void nestedObjectAccess();
void subscriptionsInConditionalExpressions();
void qtbug_21883();
+ void qtbug_22816();
private:
QDeclarativeEngine engine;
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"