summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-14 05:15:10 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-14 05:15:10 (GMT)
commitc84227fbd5e068859f8de15e4c522b076885b9dc (patch)
tree47134a7305c22bd3a20fa3ed87680eb27ed7270a /src/declarative/fx
parent4922be635aeaf25343892a73b30ec0d99d467e37 (diff)
downloadQt-c84227fbd5e068859f8de15e4c522b076885b9dc.zip
Qt-c84227fbd5e068859f8de15e4c522b076885b9dc.tar.gz
Qt-c84227fbd5e068859f8de15e4c522b076885b9dc.tar.bz2
Add list accessors for Item::children and Item::resources
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxitem.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 6324724..903fad7 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -1483,8 +1483,8 @@ void QFxItemPrivate::resources_removeAt(int)
int QFxItemPrivate::resources_count() const
{
- // ###
- return 0;
+ Q_Q(const QFxItem);
+ return q->children().count();
}
void QFxItemPrivate::resources_append(QObject *o)
@@ -1498,10 +1498,14 @@ void QFxItemPrivate::resources_insert(int, QObject *)
// ###
}
-QObject *QFxItemPrivate::resources_at(int) const
+QObject *QFxItemPrivate::resources_at(int idx) const
{
- // ###
- return 0;
+ Q_Q(const QFxItem);
+ QObjectList children = q->children();
+ if (idx < children.count())
+ return children.at(idx);
+ else
+ return 0;
}
void QFxItemPrivate::resources_clear()
@@ -1516,8 +1520,8 @@ void QFxItemPrivate::children_removeAt(int)
int QFxItemPrivate::children_count() const
{
- // ###
- return 0;
+ Q_Q(const QFxItem);
+ return q->childItems().count();
}
void QFxItemPrivate::children_append(QFxItem *i)
@@ -1531,10 +1535,14 @@ void QFxItemPrivate::children_insert(int, QFxItem *)
// ###
}
-QFxItem *QFxItemPrivate::children_at(int) const
+QFxItem *QFxItemPrivate::children_at(int idx) const
{
- // ###
- return 0;
+ Q_Q(const QFxItem);
+ QList<QGraphicsItem *> children = q->childItems();
+ if (idx < children.count())
+ return qobject_cast<QFxItem *>(children.at(idx));
+ else
+ return 0;
}
void QFxItemPrivate::children_clear()