From 3a67542e06d15386af10056caface835ed8b8e48 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 16 Jul 2013 15:35:10 +0200 Subject: Forward port auto test for fix in QtQuick1 This is the auto-test part of https://codereview.qt-project.org/#change,61117 The test passes as-is but we should forward the fix to ensure that we don't regress. Change-Id: Ief8fcfc29d671f33cd1b2c3bab7acfd4fcd1df2b Reviewed-by: Andrew den Exter --- tests/auto/qml/qqmllanguage/data/DeepComponent.qml | 7 +++++++ tests/auto/qml/qqmllanguage/data/deepProperty.qml | 4 ++++ tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/auto/qml/qqmllanguage/data/DeepComponent.qml create mode 100644 tests/auto/qml/qqmllanguage/data/deepProperty.qml (limited to 'tests/auto/qml/qqmllanguage') diff --git a/tests/auto/qml/qqmllanguage/data/DeepComponent.qml b/tests/auto/qml/qqmllanguage/data/DeepComponent.qml new file mode 100644 index 0000000000..893c358dbe --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/DeepComponent.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 +Item { + property alias someObject: text + Text { + id: text + } +} diff --git a/tests/auto/qml/qqmllanguage/data/deepProperty.qml b/tests/auto/qml/qqmllanguage/data/deepProperty.qml new file mode 100644 index 0000000000..b3c7f68640 --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/deepProperty.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 +DeepComponent { + someObject.font.family: "test" +} diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 47a9f3927b..fd35a5b873 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -190,6 +191,8 @@ private slots: void scopedProperties(); + void deepProperty(); + private: QQmlEngine engine; QStringList defaultImportPathList; @@ -3150,6 +3153,15 @@ void tst_qqmllanguage::scopedProperties() QVERIFY(o->property("success").toBool()); } +void tst_qqmllanguage::deepProperty() +{ + QQmlComponent component(&engine, testFile("deepProperty.qml")); + QScopedPointer o(component.create()); + QVERIFY(o != 0); + QFont font = qvariant_cast(qvariant_cast(o->property("someObject"))->property("font")); + QCOMPARE(font.family(), QStringLiteral("test")); +} + // Tests that the implicit import has lowest precedence, in the case where // there are conflicting types and types only found in the local import. // Tests that just check one (or the root) type are in ::importsOrder -- cgit v1.2.3