aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp')
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 55f93c62c9..353e4ee7db 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -245,7 +245,7 @@ private:
QCOMPARE(obj->property("test"), value); \
\
delete obj; \
-}
+}
void tst_qqmlcontext::setContextProperty()
{
@@ -287,56 +287,56 @@ void tst_qqmlcontext::setContextProperty()
// Changes in context properties
{
- QQmlComponent component(&engine);
+ QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; QtObject { property variant test: a }", QUrl());
- QObject *obj = component.create(&ctxt2);
+ QObject *obj = component.create(&ctxt2);
- QCOMPARE(obj->property("test"), QVariant(13));
+ QCOMPARE(obj->property("test"), QVariant(13));
ctxt.setContextProperty("a", QVariant(19));
- QCOMPARE(obj->property("test"), QVariant(19));
+ QCOMPARE(obj->property("test"), QVariant(19));
- delete obj;
+ delete obj;
}
{
- QQmlComponent component(&engine);
+ QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; QtObject { property variant test: b }", QUrl());
- QObject *obj = component.create(&ctxt2);
+ QObject *obj = component.create(&ctxt2);
- QCOMPARE(obj->property("test"), QVariant(8));
+ QCOMPARE(obj->property("test"), QVariant(8));
ctxt.setContextProperty("b", QVariant(5));
- QCOMPARE(obj->property("test"), QVariant(8));
+ QCOMPARE(obj->property("test"), QVariant(8));
ctxt2.setContextProperty("b", QVariant(1912));
- QCOMPARE(obj->property("test"), QVariant(1912));
+ QCOMPARE(obj->property("test"), QVariant(1912));
- delete obj;
+ delete obj;
}
{
- QQmlComponent component(&engine);
+ QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; QtObject { property variant test: e.a }", QUrl());
- QObject *obj = component.create(&ctxt2);
+ QObject *obj = component.create(&ctxt2);
- QCOMPARE(obj->property("test"), QVariant(12));
+ QCOMPARE(obj->property("test"), QVariant(12));
obj1.setA(13);
- QCOMPARE(obj->property("test"), QVariant(13));
+ QCOMPARE(obj->property("test"), QVariant(13));
- delete obj;
+ delete obj;
}
// New context properties
{
- QQmlComponent component(&engine);
+ QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; QtObject { property variant test: a }", QUrl());
- QObject *obj = component.create(&ctxt2);
+ QObject *obj = component.create(&ctxt2);
- QCOMPARE(obj->property("test"), QVariant(19));
+ QCOMPARE(obj->property("test"), QVariant(19));
ctxt2.setContextProperty("a", QVariant(1945));
- QCOMPARE(obj->property("test"), QVariant(1945));
+ QCOMPARE(obj->property("test"), QVariant(1945));
- delete obj;
+ delete obj;
}
// Setting an object-variant context property
@@ -389,16 +389,16 @@ void tst_qqmlcontext::setContextObject()
// Changes in context properties
{
- QQmlComponent component(&engine);
+ QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; QtObject { property variant test: a }", QUrl());
- QObject *obj = component.create(&ctxt);
+ QObject *obj = component.create(&ctxt);
- QCOMPARE(obj->property("test"), QVariant(12));
+ QCOMPARE(obj->property("test"), QVariant(12));
to.setA(14);
- QCOMPARE(obj->property("test"), QVariant(14));
+ QCOMPARE(obj->property("test"), QVariant(14));
- delete obj;
+ delete obj;
}
}