diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-06-11 00:14:13 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-06-11 00:14:13 (GMT) |
commit | 90786cb0d8dd8da2cc53258c93c0129f7c4095fc (patch) | |
tree | cad23d61e75d2a051753544e4256d325bb103120 /src | |
parent | f50b196c3bf2b18e3b1e66f8459be94b42326dc6 (diff) | |
download | Qt-90786cb0d8dd8da2cc53258c93c0129f7c4095fc.zip Qt-90786cb0d8dd8da2cc53258c93c0129f7c4095fc.tar.gz Qt-90786cb0d8dd8da2cc53258c93c0129f7c4095fc.tar.bz2 |
Avoid recursive refill() in List/GridView
Task-number: QTBUG-11362
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativegridview.cpp | 16 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 16 |
2 files changed, 12 insertions, 20 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index ed1d271..da01eb5 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -897,12 +897,10 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m timeline.reset(data.move); if (viewPos != position()) { - if (fixupDuration) { + if (fixupDuration) timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - } else { - data.move.setValue(-viewPos); - q->viewportMoved(); - } + else + timeline.set(data.move, -viewPos); } vTime = timeline.time(); } @@ -911,12 +909,10 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m qreal dist = qAbs(data.move.value() - pos); if (dist > 0) { timeline.reset(data.move); - if (fixupDuration) { + if (fixupDuration) timeline.move(data.move, pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - } else { - data.move.setValue(pos); - q->viewportMoved(); - } + else + timeline.set(data.move, pos); vTime = timeline.time(); } } else { diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 3f2b4ce..4848008 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1144,12 +1144,10 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m timeline.reset(data.move); if (viewPos != position()) { - if (fixupDuration) { + if (fixupDuration) timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - } else { - data.move.setValue(-viewPos); - q->viewportMoved(); - } + else + timeline.set(data.move, -viewPos); } vTime = timeline.time(); } @@ -1159,12 +1157,10 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m qreal dist = qAbs(data.move + pos); if (dist > 0) { timeline.reset(data.move); - if (fixupDuration) { + if (fixupDuration) timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - } else { - data.move.setValue(-pos); - q->viewportMoved(); - } + else + timeline.set(data.move, -pos); vTime = timeline.time(); } } |