summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxrepeater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx/qfxrepeater.cpp')
-rw-r--r--src/declarative/fx/qfxrepeater.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp
index 5ef7b10..bc34839 100644
--- a/src/declarative/fx/qfxrepeater.cpp
+++ b/src/declarative/fx/qfxrepeater.cpp
@@ -282,26 +282,13 @@ void QFxRepeater::regenerate()
if (!d->model || !d->model->count() || !d->model->isValid() || !parentItem() || !isComponentComplete())
return;
- //In order to do the insertion like the examples, we have to be at the
- //same point in the childItems() list. Temporary measure until we think of something better
- int pos = parentItem()->childItems().indexOf(this);
- Q_ASSERT(pos != -1);
- QList<QGraphicsItem*> otherChildren;
- for (int ii = pos+1; ii < parentItem()->childItems().count(); ii++){
- QGraphicsItem* otherChild = parentItem()->childItems()[ii];
- otherChildren << otherChild;
- otherChild->setParentItem(0);
- }
-
for (int ii = 0; ii < count(); ++ii) {
QFxItem *item = d->model->item(ii);
if (item) {
item->setParent(parentItem());
+ item->stackBefore(this);
d->deletables << item;
}
}
-
- foreach(QGraphicsItem* other, otherChildren)
- other->setParentItem(parentItem());
}
QT_END_NAMESPACE