QScrollerPrivate: fix some const-incorrectnesses

Change-Id: Iad7ea926b90efa54ef94c04ac78e38254d9b5c98
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Marc Mutz 2015-12-16 01:59:15 +01:00
parent 46ed6c058a
commit a1bb00bece
3 changed files with 8 additions and 8 deletions

View File

@ -1005,7 +1005,7 @@ bool QScroller::handleInput(Input input, const QPointF &position, qint64 timesta
#if !defined(Q_DEAD_CODE_FROM_QT4_MAC) #if !defined(Q_DEAD_CODE_FROM_QT4_MAC)
// the Mac version is implemented in qscroller_mac.mm // the Mac version is implemented in qscroller_mac.mm
QPointF QScrollerPrivate::realDpi(int screen) QPointF QScrollerPrivate::realDpi(int screen) const
{ {
# if defined(Q_DEAD_CODE_FROM_QT4_X11) && !defined(QT_NO_XRANDR) # if defined(Q_DEAD_CODE_FROM_QT4_X11) && !defined(QT_NO_XRANDR)
if (X11 && X11->use_xrandr && X11->ptrXRRSizes && X11->ptrXRRRootToScreen) { if (X11 && X11->use_xrandr && X11->ptrXRRSizes && X11->ptrXRRRootToScreen) {
@ -1176,9 +1176,9 @@ qreal QScrollerPrivate::scrollingSegmentsEndPos(Qt::Orientation orientation) con
/*! \internal /*! \internal
Checks if the scroller segment end in a valid position. Checks if the scroller segment end in a valid position.
*/ */
bool QScrollerPrivate::scrollingSegmentsValid(Qt::Orientation orientation) bool QScrollerPrivate::scrollingSegmentsValid(Qt::Orientation orientation) const
{ {
QQueue<ScrollSegment> *segments; const QQueue<ScrollSegment> *segments;
qreal minPos; qreal minPos;
qreal maxPos; qreal maxPos;
@ -1893,7 +1893,7 @@ void QScrollerPrivate::setContentPositionHelperScrolling()
on a snap point. on a snap point.
Returns the nearest snap position or NaN if no such point could be found. Returns the nearest snap position or NaN if no such point could be found.
*/ */
qreal QScrollerPrivate::nextSnapPos(qreal p, int dir, Qt::Orientation orientation) qreal QScrollerPrivate::nextSnapPos(qreal p, int dir, Qt::Orientation orientation) const
{ {
qreal bestSnapPos = Q_QNAN; qreal bestSnapPos = Q_QNAN;
qreal bestSnapPosDist = Q_INFINITY; qreal bestSnapPosDist = Q_INFINITY;

View File

@ -41,7 +41,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
QPointF QScrollerPrivate::realDpi(int screen) QPointF QScrollerPrivate::realDpi(int screen) const
{ {
QMacAutoReleasePool pool; QMacAutoReleasePool pool;
NSArray *nsscreens = [NSScreen screens]; NSArray *nsscreens = [NSScreen screens];

View File

@ -112,7 +112,7 @@ public:
bool prepareScrolling(const QPointF &position); bool prepareScrolling(const QPointF &position);
void handleDrag(const QPointF &position, qint64 timestamp); void handleDrag(const QPointF &position, qint64 timestamp);
QPointF realDpi(int screen); QPointF realDpi(int screen) const;
QPointF dpi() const; QPointF dpi() const;
void setDpi(const QPointF &dpi); void setDpi(const QPointF &dpi);
void setDpiFromWidget(QWidget *widget); void setDpiFromWidget(QWidget *widget);
@ -121,7 +121,7 @@ public:
void pushSegment(ScrollType type, qreal deltaTime, qreal stopProgress, qreal startPos, qreal deltaPos, qreal stopPos, QEasingCurve::Type curve, Qt::Orientation orientation); void pushSegment(ScrollType type, qreal deltaTime, qreal stopProgress, qreal startPos, qreal deltaPos, qreal stopPos, QEasingCurve::Type curve, Qt::Orientation orientation);
void recalcScrollingSegments(bool forceRecalc = false); void recalcScrollingSegments(bool forceRecalc = false);
qreal scrollingSegmentsEndPos(Qt::Orientation orientation) const; qreal scrollingSegmentsEndPos(Qt::Orientation orientation) const;
bool scrollingSegmentsValid(Qt::Orientation orientation); bool scrollingSegmentsValid(Qt::Orientation orientation) const;
void createScrollToSegments(qreal v, qreal deltaTime, qreal endPos, Qt::Orientation orientation, ScrollType type); void createScrollToSegments(qreal v, qreal deltaTime, qreal endPos, Qt::Orientation orientation, ScrollType type);
void createScrollingSegments(qreal v, qreal startPos, void createScrollingSegments(qreal v, qreal startPos,
qreal deltaTime, qreal deltaPos, qreal deltaTime, qreal deltaPos,
@ -131,7 +131,7 @@ public:
void setContentPositionHelperDragging(const QPointF &deltaPos); void setContentPositionHelperDragging(const QPointF &deltaPos);
void setContentPositionHelperScrolling(); void setContentPositionHelperScrolling();
qreal nextSnapPos(qreal p, int dir, Qt::Orientation orientation); qreal nextSnapPos(qreal p, int dir, Qt::Orientation orientation) const;
static qreal nextSegmentPosition(QQueue<ScrollSegment> &segments, qint64 now, qreal oldPos); static qreal nextSegmentPosition(QQueue<ScrollSegment> &segments, qint64 now, qreal oldPos);
inline int frameRateSkip() const { return properties.d.data()->frameRate; } inline int frameRateSkip() const { return properties.d.data()->frameRate; }