diff options
author | mread <qt-info@nokia.com> | 2011-10-05 15:40:26 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2011-10-05 15:51:27 (GMT) |
commit | 6e1b00087902866cd4c0e3057690d045356869f0 (patch) | |
tree | 7e3a0f471235923c9b22a6fbd3e0a84c33af0a9d /src/declarative/graphicsitems/qdeclarativelistview.cpp | |
parent | 2a6298bcf29104a4258992c7357a031f4ca9cc7f (diff) | |
download | Qt-6e1b00087902866cd4c0e3057690d045356869f0.zip Qt-6e1b00087902866cd4c0e3057690d045356869f0.tar.gz Qt-6e1b00087902866cd4c0e3057690d045356869f0.tar.bz2 |
Converting accidental use of doubles to qreal in declarative
Declarative had a number of places where double operations were used
instead of qreal, due to the use of double literals. These are now
constructed as qreal literals so that qreal operations are used.
This makes no difference where qreal is double. But on Symbian, qreal
is float, and this give a performance boost for floating point intensive
code.
Task-number: QTBUG-4894
Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativelistview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 6a91e5f..44d6a1a 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1457,14 +1457,14 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m // the initial flick - estimate boundary qreal accel = deceleration; qreal v2 = v * v; - overshootDist = 0.0; + overshootDist = qreal(0.0); // + averageSize/4 to encourage moving at least one item in the flick direction - qreal dist = v2 / (accel * 2.0) + averageSize/4; + qreal dist = v2 / (accel * qreal(2.0)) + averageSize/4; if (maxDistance > 0) dist = qMin(dist, maxDistance); if (v > 0) dist = -dist; - if ((maxDistance > 0.0 && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeListView::SnapOneItem) { + if ((maxDistance > qreal(0.0) && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeListView::SnapOneItem) { if (snapMode != QDeclarativeListView::SnapOneItem) { qreal distTemp = isRightToLeft() ? -dist : dist; data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart; |