diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-05-20 04:42:44 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-05-20 04:42:44 (GMT) |
commit | ded29009f766a8373193d94bcb8309270f66a266 (patch) | |
tree | 81e255543c361c0fee8f8f5488188140b1a65c3a /src/declarative/fx/qfxpathview.cpp | |
parent | 121b9bfaf404c602f40056d6c82c9cb2bb477ab6 (diff) | |
download | Qt-ded29009f766a8373193d94bcb8309270f66a266.zip Qt-ded29009f766a8373193d94bcb8309270f66a266.tar.gz Qt-ded29009f766a8373193d94bcb8309270f66a266.tar.bz2 |
Make VisualItemModel with packages work properly.
The views can all now deal with items that they have not requested
appearing, and will lay them out appropriately.
Diffstat (limited to 'src/declarative/fx/qfxpathview.cpp')
-rw-r--r-- | src/declarative/fx/qfxpathview.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index b7215cf..b1c78e9 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -159,7 +159,7 @@ void QFxPathView::setModel(const QVariant &model) if (d->model) { disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); - disconnect(d->model, SIGNAL(itemCreated(int, QFxItem*)), this, SLOT(itemCreated(int,QFxItem*))); + disconnect(d->model, SIGNAL(createdItem(int, QFxItem*)), this, SLOT(createdItem(int,QFxItem*))); for (int i=0; i<d->items.count(); i++){ QFxItem *p = d->items[i]; d->model->release(p); @@ -186,7 +186,7 @@ void QFxPathView::setModel(const QVariant &model) if (d->model) { connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); - connect(d->model, SIGNAL(itemCreated(int, QFxItem*)), this, SLOT(itemCreated(int,QFxItem*))); + connect(d->model, SIGNAL(createdItem(int, QFxItem*)), this, SLOT(createdItem(int,QFxItem*))); } d->firstIndex = 0; d->pathOffset = 0; @@ -559,9 +559,10 @@ bool QFxPathView::mouseFilter(QGraphicsSceneMouseEvent *e) void QFxPathViewPrivate::regenerate() { Q_Q(QFxPathView); + qDebug() << "relaease all pathview"; for (int i=0; i<items.count(); i++){ QFxItem *p = items[i]; - model->release(p); + releaseItem(p); } items.clear(); @@ -634,7 +635,7 @@ void QFxPathView::refill() while(wrapIndex-- >= 0){ QFxItem* p = d->items.takeFirst(); d->updateItem(p, 0.0); - d->model->release(p); + d->releaseItem(p); d->firstIndex++; d->firstIndex %= d->model->count(); int index = (d->firstIndex + d->items.count())%d->model->count(); @@ -647,7 +648,7 @@ void QFxPathView::refill() while(wrapIndex++ < d->items.count()-1){ QFxItem* p = d->items.takeLast(); d->updateItem(p, 1.0); - d->model->release(p); + d->releaseItem(p); d->firstIndex--; if (d->firstIndex < 0) d->firstIndex = d->model->count() - 1; @@ -698,6 +699,7 @@ void QFxPathView::itemsInserted(int modelIndex, int count) void QFxPathView::itemsRemoved(int modelIndex, int count) { + qDebug() << "QFxPathView::itemsRemoved"; //XXX support animated removal Q_D(QFxPathView); if (!d->isValid()) @@ -733,7 +735,7 @@ void QFxPathView::itemsRemoved(int modelIndex, int count) d->moveOffset.setValue(targetOffset); } -void QFxPathView::itemCreated(int index, QFxItem *item) +void QFxPathView::createdItem(int index, QFxItem *item) { Q_D(QFxPathView); if (d->requestedIndex != index) { |