diff options
author | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-11-26 17:22:54 +0100 |
---|---|---|
committer | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-11-26 17:22:54 +0100 |
commit | 1ee4e9d4a164ab7dc610d9afcdc544293d374cf4 (patch) | |
tree | bf96bc4308bec8fbd6f6966af2e4e427a89a2546 /src | |
parent | 57cf88be37312919ae4e7dc350a8eb5fb15c89ba (diff) |
Update the graphics path view.
Diffstat (limited to 'src')
-rw-r--r-- | src/experimental/qgraphicspathview.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
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); |