aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-08-26 09:51:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-08-26 11:21:16 +0200
commite525c551394ba2827e4494bfb72ff43171e9b7e1 (patch)
treea7223403990a45bbaf8037600f282c1d01a6e811 /tests/auto/qml/qqmllanguage
parent1075dca1b50926f52daddf099b5f5a9fbb5da6c7 (diff)
parente9e6f70d355499d551a26960d236644f92ea38af (diff)
Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
Diffstat (limited to 'tests/auto/qml/qqmllanguage')
-rw-r--r--tests/auto/qml/qqmllanguage/data/earlyIdObjectAccess.qml23
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp10
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/earlyIdObjectAccess.qml b/tests/auto/qml/qqmllanguage/data/earlyIdObjectAccess.qml
new file mode 100644
index 0000000000..22c335b1a7
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/earlyIdObjectAccess.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+
+Item {
+ visible: false
+ property bool success: false
+ property bool loading: true
+
+ Item {
+ visible: someOtherItem.someProperty
+ onVisibleChanged: {
+ if (!visible) {
+ success = loading
+ }
+ }
+ }
+
+ Item {
+ id: someOtherItem
+ property bool someProperty: true
+ }
+
+ Component.onCompleted: loading = false
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 05cdccfb51..d6d2911285 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -235,6 +235,8 @@ private slots:
void noChildEvents();
+ void earlyIdObjectAccess();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -3970,6 +3972,14 @@ void tst_qqmllanguage::noChildEvents()
QCOMPARE(object->childAddedEventCount(), 0);
}
+void tst_qqmllanguage::earlyIdObjectAccess()
+{
+ QQmlComponent component(&engine, testFileUrl("earlyIdObjectAccess.qml"));
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+ QVERIFY(o->property("success").toBool());
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"