diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp index 26c8231..4c9c9ca 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp +++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp @@ -68,6 +68,7 @@ private slots: void reassignedAnimation(); void disabled(); void dontStart(); + void startup(); }; void tst_qdeclarativebehaviors::simpleBehavior() @@ -326,6 +327,21 @@ void tst_qdeclarativebehaviors::dontStart() delete rect; } +void tst_qdeclarativebehaviors::startup() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup.qml")); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QVERIFY(rect); + + QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect"); + QVERIFY(innerRect); + + QCOMPARE(innerRect->x(), qreal(100)); //should be set immediately + + delete rect; +} + QTEST_MAIN(tst_qdeclarativebehaviors) #include "tst_qdeclarativebehaviors.moc" |