summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index 80ba907d20..4536d9ef27 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -81,6 +81,7 @@ private slots:
void groupedPropertyCrash();
void runningTrue();
void sameValue();
+ void delayedRegistration();
};
void tst_qdeclarativebehaviors::simpleBehavior()
@@ -412,6 +413,23 @@ void tst_qdeclarativebehaviors::sameValue()
QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
}
+//QTBUG-18362
+void tst_qdeclarativebehaviors::delayedRegistration()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/delayedRegistration.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItem *innerRect = rect->property("myItem").value<QDeclarativeItem*>();
+ QVERIFY(innerRect != 0);
+
+ QCOMPARE(innerRect->property("x").toInt(), int(0));
+
+ QTRY_COMPARE(innerRect->property("x").toInt(), int(100));
+}
+
QTEST_MAIN(tst_qdeclarativebehaviors)
#include "tst_qdeclarativebehaviors.moc"