aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-07-26 11:52:06 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-07-26 11:52:32 +0200
commit993bc84f49b4922480f6ec566f31c24465f0e005 (patch)
tree5189edc8e2e0942459d09a4765ad17dd681fe801 /tests/auto/qml/qqmllanguage
parent713a4c5b1d601f57d538fdbb1e8f6bc05ce07275 (diff)
parent84871192077c18bb093c6259339200bd22d64f00 (diff)
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into merge
Diffstat (limited to 'tests/auto/qml/qqmllanguage')
-rw-r--r--tests/auto/qml/qqmllanguage/data/DeepComponent.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/deepProperty.qml4
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp12
3 files changed, 23 insertions, 0 deletions
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 29c4463471..852034cbde 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -48,6 +48,7 @@
#include <QtCore/qfileinfo.h>
#include <QtCore/qdir.h>
#include <QSignalSpy>
+#include <QFont>
#include <private/qqmlproperty_p.h>
#include <private/qqmlmetatype_p.h>
@@ -190,6 +191,8 @@ private slots:
void scopedProperties();
+ void deepProperty();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -3149,6 +3152,15 @@ void tst_qqmllanguage::scopedProperties()
QVERIFY(o->property("success").toBool());
}
+void tst_qqmllanguage::deepProperty()
+{
+ QQmlComponent component(&engine, testFile("deepProperty.qml"));
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(o != 0);
+ QFont font = qvariant_cast<QFont>(qvariant_cast<QObject*>(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