summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-07 03:00:08 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-07 03:00:54 (GMT)
commit062e30769c2b04a5d8d0906c39a2bcb35defd3a2 (patch)
treeb5c0d58f011583918e06b06d187ed504c7ac5fa8 /tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
parent973cfce37fcdd1ce330f237eaa76930db55a73f6 (diff)
downloadQt-062e30769c2b04a5d8d0906c39a2bcb35defd3a2.zip
Qt-062e30769c2b04a5d8d0906c39a2bcb35defd3a2.tar.gz
Qt-062e30769c2b04a5d8d0906c39a2bcb35defd3a2.tar.bz2
Allow iteration over the Item.children property
QTBUG-9645
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 46f3517..a6171ae 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -64,6 +64,9 @@ private slots:
void transforms();
void transforms_data();
+ void childrenProperty();
+ void resourcesProperty();
+
private:
template<typename T>
T *findItem(QGraphicsObject *parent, const QString &objectName);
@@ -429,6 +432,36 @@ void tst_QDeclarativeItem::transforms()
QCOMPARE(item->sceneMatrix(), matrix);
}
+void tst_QDeclarativeItem::childrenProperty()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/childrenProperty.qml");
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+ delete o;
+}
+
+void tst_QDeclarativeItem::resourcesProperty()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/resourcesProperty.qml");
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+ delete o;
+}
+
void tst_QDeclarativeItem::propertyChanges()
{
QDeclarativeView *canvas = new QDeclarativeView(0);