summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativerepeater.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-03-30 00:08:57 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-03-30 00:08:57 (GMT)
commitf5504a76518c65644b665f9c16299fbe423015db (patch)
tree90d15148cf797cd2666daf32ced97d77cbb47a50 /src/declarative/graphicsitems/qdeclarativerepeater.cpp
parentcee97322cab0c14e1e3cce7773ba82c6aca86bb3 (diff)
downloadQt-f5504a76518c65644b665f9c16299fbe423015db.zip
Qt-f5504a76518c65644b665f9c16299fbe423015db.tar.gz
Qt-f5504a76518c65644b665f9c16299fbe423015db.tar.bz2
Correctly parent repeater items.
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativerepeater.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index e8f9b24..bbee4e5 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -43,7 +43,7 @@
#include "qdeclarativerepeater_p_p.h"
#include "qdeclarativevisualitemmodel_p.h"
-
+#include <private/qdeclarativeglobal_p.h>
#include <qdeclarativelistaccessor_p.h>
#include <qlistmodelinterface_p.h>
@@ -283,7 +283,6 @@ void QDeclarativeRepeater::clear()
Q_D(QDeclarativeRepeater);
if (d->model) {
foreach (QDeclarativeItem *item, d->deletables) {
- item->setParentItem(this);
d->model->release(item);
}
}
@@ -307,7 +306,8 @@ void QDeclarativeRepeater::regenerate()
for (int ii = 0; ii < count(); ++ii) {
QDeclarativeItem *item = d->model->item(ii);
if (item) {
- item->setParent(parentItem());
+ QDeclarative_setParent_noEvent(item, parentItem());
+ item->setParentItem(parentItem());
item->stackBefore(this);
d->deletables << item;
}
@@ -323,7 +323,8 @@ void QDeclarativeRepeater::itemsInserted(int index, int count)
int modelIndex = index + i;
QDeclarativeItem *item = d->model->item(modelIndex);
if (item) {
- item->setParent(parentItem());
+ QDeclarative_setParent_noEvent(item, parentItem());
+ item->setParentItem(parentItem());
if (modelIndex < d->deletables.count())
item->stackBefore(d->deletables.at(modelIndex));
else
@@ -341,7 +342,6 @@ void QDeclarativeRepeater::itemsRemoved(int index, int count)
while (count--) {
QDeclarativeItem *item = d->deletables.takeAt(index);
if (item) {
- item->setParentItem(this);
d->model->release(item);
}
}