diff options
Diffstat (limited to 'src/experimental/qgraphicspathview.cpp')
-rw-r--r-- | src/experimental/qgraphicspathview.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/experimental/qgraphicspathview.cpp b/src/experimental/qgraphicspathview.cpp index ed1876c..a20f8d5 100644 --- a/src/experimental/qgraphicspathview.cpp +++ b/src/experimental/qgraphicspathview.cpp @@ -165,9 +165,9 @@ void QtGraphicsPathView::doLayout() qreal progress = /*animationProgress()*/1 - (running && forward ? 1 : 0); while (!path.isEmpty() && counter < count) { - initStyleOption(&option, index); + //initStyleOption(&option, index); qreal c = qreal(counter) + progress; - QSizeF size = d->itemSizeHint(&option, index); + QSizeF size = d->itemSize(index); //qreal scale = (qreal(count - qAbs(c - (count / 2))) / qreal(count)); qreal t = qBound(qreal(0), c / qreal(count), qreal(1)); QPointF pos = path.pointAtPercent(t); @@ -176,15 +176,16 @@ void QtGraphicsPathView::doLayout() pos += boundingRect.topLeft(); // ### FIXME: look up and recycle the items - QtGraphicsListViewItem *item = 0; + QGraphicsObject *item = 0; if (counter >= d->items.count()) { item = d->creator->create(index, this); - d->items.append(item); + d->items.append(QPair<int,QGraphicsObject*>(index, item)); } else { - item = d->items.at(counter); - item->setIndex(index); // ### + item = d->items.at(counter).second; + d->creator->reassign(index, item, this); + //item->setIndex(index); // ### } - item->setGeometry(QRectF(pos, size)); + item->setPos(pos); ++index; if (index >= count) // loop |