From 1ee4e9d4a164ab7dc610d9afcdc544293d374cf4 Mon Sep 17 00:00:00 2001 From: Marius Bugge Monsen Date: Thu, 26 Nov 2009 17:22:54 +0100 Subject: Update the graphics path view. --- src/experimental/qgraphicspathview.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/experimental/qgraphicspathview.cpp b/src/experimental/qgraphicspathview.cpp index 7ab8959..e985925 100644 --- a/src/experimental/qgraphicspathview.cpp +++ b/src/experimental/qgraphicspathview.cpp @@ -64,17 +64,15 @@ void QtGraphicsPathViewPrivate::_q_currentChanged(int current, int previous) { Q_UNUSED(current); Q_UNUSED(previous); - /**/ QTimeLine::Direction direction = current > previous ? QTimeLine::Backward : QTimeLine::Forward; if (previous == 0 && current == model->count() - 1) direction = QTimeLine::Forward; if (current == 0 && previous == model->count() - 1) direction = QTimeLine::Backward; timeline.stop(); - timeline.setDuration(1000); + timeline.setDuration(500); timeline.setDirection(direction); timeline.start(); - /**/ } /*! @@ -85,9 +83,6 @@ void QtGraphicsPathViewPrivate::_q_currentChanged(int current, int previous) QtGraphicsPathView::QtGraphicsPathView(QGraphicsWidget *parent, Qt::WindowFlags wFlags) : QtGraphicsListView(*(new QtGraphicsPathViewPrivate), Qt::Vertical, parent, wFlags) { - //Q_D(QtGraphicsPathView); - //connect(&d->timeline, SIGNAL(valueChanged(qreal)), this, SLOT(_q_update())); - //connect(&d->timeline, SIGNAL(finished()), this, SLOT(update())); } QtGraphicsPathView::~QtGraphicsPathView() @@ -145,7 +140,7 @@ void QtGraphicsPathView::doLayout() const QPainterPath path = d->path; const int firstItem = 0; // ### const int count = model() ? model()->count() - (firstItem * 2) : 0; // ### - const int current = qBound(firstItem, /*forward ? d->currentItem() - 1:*/ d->currentItem(), count); + const int current = qBound(firstItem, d->currentItem(), count); const int n = (current - (count / 2)); int index = (n < 0 ? n + count : n); @@ -166,8 +161,6 @@ void QtGraphicsPathView::doLayout() while (!path.isEmpty() && counter < count) { qreal c = qreal(counter) + progress; - //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); pos.rx() *= horizontalFactor; @@ -182,7 +175,6 @@ void QtGraphicsPathView::doLayout() } else { item = d->items.at(counter).second; d->creator->reassign(index, item, this); - //item->setIndex(index); // ### } item->setPos(pos); -- cgit v1.2.3