summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicspathview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicspathview.cpp')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspathview.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicspathview.cpp b/src/declarative/graphicsitems/qmlgraphicspathview.cpp
index 4511820..aba184d 100644
--- a/src/declarative/graphicsitems/qmlgraphicspathview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicspathview.cpp
@@ -54,9 +54,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,PathView,QmlGraphicsPathView)
-
-
inline qreal qmlMod(qreal x, qreal y)
{
#ifdef QT_USE_MATH_H_FLOATS
@@ -527,7 +524,7 @@ void QmlGraphicsPathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
qreal dist = qAbs(velocity/2 - qmlMod(velocity/2, qreal(100.0 / d->model->count()) - inc));
d->moveOffset.setValue(d->_offset);
d->tl.accel(d->moveOffset, velocity, 10, dist);
- d->tl.execute(d->fixupOffsetEvent);
+ d->tl.callback(QmlTimeLineCallback(&d->moveOffset, d->fixOffsetCallback, d));
} else {
d->fixOffset();
}
@@ -889,6 +886,11 @@ void QmlGraphicsPathViewPrivate::updateCurrent()
}
}
+void QmlGraphicsPathViewPrivate::fixOffsetCallback(void *d)
+{
+ ((QmlGraphicsPathViewPrivate *)d)->fixOffset();
+}
+
void QmlGraphicsPathViewPrivate::fixOffset()
{
Q_Q(QmlGraphicsPathView);
@@ -941,7 +943,7 @@ void QmlGraphicsPathViewPrivate::snapToCurrent()
rounds++;
tl.move(moveOffset, targetOffset + 100.0*(-rounds), QEasingCurve(QEasingCurve::InOutQuad),
int(100*items.count()*qMax((qreal)(2.0/items.count()),(qreal)qAbs(rounds))));
- tl.execute(fixupOffsetEvent);
+ tl.callback(QmlTimeLineCallback(&moveOffset, fixOffsetCallback, this));
return;
}