diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-04-16 04:42:29 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-04-16 04:42:29 (GMT) |
commit | 373780483dc369eca84157975e26369259f152fd (patch) | |
tree | 5b4f48fb8a42cc87af3709a411bc117321809863 /tests/auto | |
parent | 348d1f6d421a6e23b769af99608fa6d81631a6c3 (diff) | |
parent | 8ff39e55286e4ce3f01472fafa06941c9e9537fd (diff) | |
download | Qt-373780483dc369eca84157975e26369259f152fd.zip Qt-373780483dc369eca84157975e26369259f152fd.tar.gz Qt-373780483dc369eca84157975e26369259f152fd.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp index a08a91c..da2d173 100644 --- a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp +++ b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp @@ -43,6 +43,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <private/qdeclarativetimer_p.h> +#include <QtDeclarative/qdeclarativeitem.h> #include <QDebug> class tst_qdeclarativetimer : public QObject @@ -60,6 +61,7 @@ private slots: void triggeredOnStartRepeat(); void changeDuration(); void restart(); + void parentProperty(); }; class TimerHelper : public QObject @@ -317,6 +319,21 @@ void tst_qdeclarativetimer::restart() delete timer; } +void tst_qdeclarativetimer::parentProperty() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine); + component.setData(QByteArray("import Qt 4.7\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile("")); + QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create()); + QVERIFY(item != 0); + QDeclarativeTimer *timer = item->findChild<QDeclarativeTimer*>("timer"); + QVERIFY(timer != 0); + + QVERIFY(timer->isRunning()); + + delete timer; +} + QTEST_MAIN(tst_qdeclarativetimer) #include "tst_qdeclarativetimer.moc" |