aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp')
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index 288b4d1a01..1ccf7a6f23 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -148,6 +148,7 @@ private slots:
void loadFromQrc();
void removeBinding();
void complexObjectArgument();
+ void bindingInRequired();
private:
QQmlEngine engine;
@@ -1506,6 +1507,24 @@ void tst_qqmlcomponent::complexObjectArgument()
QCOMPARE(o->objectName(), QStringLiteral("26 - 25"));
}
+void tst_qqmlcomponent::bindingInRequired()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("bindingInRequired.qml"));
+ QVERIFY2(component.isReady(), qPrintable(component.errorString()));
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+
+ QObject *outer = object->property("outer").value<QObject *>();
+ QVERIFY(outer);
+
+ QObject *inner = object->property("inner").value<QObject *>();
+ QVERIFY(inner);
+
+ QCOMPARE(inner, outer->property("obj").value<QObject *>());
+ QVERIFY(!inner->property("obj").value<QObject *>());
+}
+
QTEST_MAIN(tst_qqmlcomponent)
#include "tst_qqmlcomponent.moc"