aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-05 10:21:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-05 15:01:07 +0100
commit247f6a34d161f10c4f6d5d516b8bfb7043ca78a2 (patch)
tree4d7c89e3b4f33279a3565d5afdb925dc21b58ba0 /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
parentc8889fbb5561d75a7a383b86daa89c1b264c6f6e (diff)
[new compiler] Fix auto component creation with composite types
A binding like this property Component foo: SomeComposite {} should not do an implicit component insertion if SomeComposite is actually a component. The property assignment is compatible and can proceed normally. Fixes tst_qquickcanvasitem, but added a separate unit test for this case. Change-Id: I7221eebd38dba3f2a82b59341739b9b67211e352 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 07644bef16..3a52d586ea 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -1342,14 +1342,26 @@ void tst_qqmllanguage::simpleBindings()
void tst_qqmllanguage::autoComponentCreation()
{
- QQmlComponent component(&engine, testFileUrl("autoComponentCreation.qml"));
- VERIFY_ERRORS(0);
- MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
- QVERIFY(object != 0);
- QVERIFY(object->componentProperty() != 0);
- MyTypeObject *child = qobject_cast<MyTypeObject *>(object->componentProperty()->create());
- QVERIFY(child != 0);
- QCOMPARE(child->realProperty(), qreal(9));
+ {
+ QQmlComponent component(&engine, testFileUrl("autoComponentCreation.qml"));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->componentProperty() != 0);
+ MyTypeObject *child = qobject_cast<MyTypeObject *>(object->componentProperty()->create());
+ QVERIFY(child != 0);
+ QCOMPARE(child->realProperty(), qreal(9));
+ }
+ {
+ QQmlComponent component(&engine, testFileUrl("autoComponentCreation.2.qml"));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->componentProperty() != 0);
+ MyTypeObject *child = qobject_cast<MyTypeObject *>(object->componentProperty()->create());
+ QVERIFY(child != 0);
+ QCOMPARE(child->realProperty(), qreal(9));
+ }
}
void tst_qqmllanguage::autoComponentCreationInGroupProperty()