summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetimer
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-16 04:17:23 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-16 04:17:23 (GMT)
commit8ff39e55286e4ce3f01472fafa06941c9e9537fd (patch)
tree9cd80737fc0416c80dc2ce76293200553cd5df49 /tests/auto/declarative/qdeclarativetimer
parent6a519b590c5e030b8f179d34448f5b45ca22c13d (diff)
downloadQt-8ff39e55286e4ce3f01472fafa06941c9e9537fd.zip
Qt-8ff39e55286e4ce3f01472fafa06941c9e9537fd.tar.gz
Qt-8ff39e55286e4ce3f01472fafa06941c9e9537fd.tar.bz2
Add test for QTBUG-9949
Task-number: QTBUG-9949
Diffstat (limited to 'tests/auto/declarative/qdeclarativetimer')
-rw-r--r--tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp17
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"