aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Montgomery <apmontgomery@gmail.com>2014-08-15 09:41:56 -0700
committerAlex Montgomery <apmontgo@codereview.qt-project.org>2014-08-15 18:48:33 +0200
commit672c533bde2899baad3eb29b6a807870abb8bf25 (patch)
tree8e8838f7c5ecd807cfb666f1dd13bf363ef3ae88 /tests
parent63f0c196eecb88804f8bbe410a38d0274955f994 (diff)
Fix setContextObject to re-evaluate bindings
Fix QQmlContext::setContextObject to reevaluate bindings as the documentation says that it should. Task-number: QTBUG-40798 Change-Id: Ifbd97c7a07a5432f4948937da863370b05705206 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 147887109f..e9c031a894 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -401,6 +401,18 @@ void tst_qqmlcontext::setContextObject()
delete obj;
}
+
+ // Change of context object
+ ctxt.setContextProperty("c", QVariant(30));
+ TestObject to2;
+ to2.setA(10);
+ to2.setB(20);
+ to2.setC(40);
+ ctxt.setContextObject(&to2);
+
+ TEST_CONTEXT_PROPERTY(&ctxt, a, QVariant(10));
+ TEST_CONTEXT_PROPERTY(&ctxt, b, QVariant(20));
+ TEST_CONTEXT_PROPERTY(&ctxt, c, QVariant(30));
}
void tst_qqmlcontext::destruction()