diff options
-rw-r--r-- | src/widgets/util/qscroller.cpp | 8 | ||||
-rw-r--r-- | src/widgets/util/qscroller_mac.mm | 2 | ||||
-rw-r--r-- | src/widgets/util/qscroller_p.h | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index bc7c11127e..5297c949a9 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -1005,7 +1005,7 @@ bool QScroller::handleInput(Input input, const QPointF &position, qint64 timesta #if !defined(Q_DEAD_CODE_FROM_QT4_MAC) // 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 (X11 && X11->use_xrandr && X11->ptrXRRSizes && X11->ptrXRRRootToScreen) { @@ -1176,9 +1176,9 @@ qreal QScrollerPrivate::scrollingSegmentsEndPos(Qt::Orientation orientation) con /*! \internal 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 maxPos; @@ -1893,7 +1893,7 @@ void QScrollerPrivate::setContentPositionHelperScrolling() on a snap point. 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 bestSnapPosDist = Q_INFINITY; diff --git a/src/widgets/util/qscroller_mac.mm b/src/widgets/util/qscroller_mac.mm index 51485973b8..1d2780ccd1 100644 --- a/src/widgets/util/qscroller_mac.mm +++ b/src/widgets/util/qscroller_mac.mm @@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE -QPointF QScrollerPrivate::realDpi(int screen) +QPointF QScrollerPrivate::realDpi(int screen) const { QMacAutoReleasePool pool; NSArray *nsscreens = [NSScreen screens]; diff --git a/src/widgets/util/qscroller_p.h b/src/widgets/util/qscroller_p.h index d09f78d130..8266b6e611 100644 --- a/src/widgets/util/qscroller_p.h +++ b/src/widgets/util/qscroller_p.h @@ -112,7 +112,7 @@ public: bool prepareScrolling(const QPointF &position); void handleDrag(const QPointF &position, qint64 timestamp); - QPointF realDpi(int screen); + QPointF realDpi(int screen) const; QPointF dpi() const; void setDpi(const QPointF &dpi); 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 recalcScrollingSegments(bool forceRecalc = false); 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 createScrollingSegments(qreal v, qreal startPos, qreal deltaTime, qreal deltaPos, @@ -131,7 +131,7 @@ public: void setContentPositionHelperDragging(const QPointF &deltaPos); 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); inline int frameRateSkip() const { return properties.d.data()->frameRate; } |