diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-09-08 18:21:03 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-11-08 11:39:38 +0000 |
commit | b254b03dc3b1cfcfc5f17158d2470e0a9a946a0e (patch) | |
tree | ff04bed068bb7f2117d0e3ed63593f12340cff2e /src/widgets/util/qscroller.cpp | |
parent | eeca8895fc7e585f497e908368b8cc1a509847d3 (diff) |
Deprecate QDesktopWidget in favor of QScreen
[ChangeLog][QtWidgets] QDesktopWidget has been deprecated. Use the
corresponding QScreen functions instead.
Task-number: QTBUG-62094
Change-Id: I0941d2aa27a06ec650ca52d6467e5bfb0ad43459
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/widgets/util/qscroller.cpp')
-rw-r--r-- | src/widgets/util/qscroller.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index a49dbe427e..8a1bcdae05 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -58,6 +58,7 @@ #include <QGraphicsView> #endif #include <QDesktopWidget> +#include <private/qdesktopwidget_p.h> #include <QVector2D> #include <QtCore/qmath.h> #include <QtGui/qevent.h> @@ -1016,7 +1017,7 @@ bool QScroller::handleInput(Input input, const QPointF &position, qint64 timesta #if 1 // Used to be excluded in Qt4 for Q_WS_MAC // the Mac version is implemented in qscroller_mac.mm -QPointF QScrollerPrivate::realDpi(int screen) const +QPointF QScrollerPrivate::realDpi(int screenNumber) const { # if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_XRANDR) if (X11 && X11->use_xrandr && X11->ptrXRRSizes && X11->ptrXRRRootToScreen) { @@ -1040,8 +1041,8 @@ QPointF QScrollerPrivate::realDpi(int screen) const } # endif - QWidget *w = QApplication::desktop()->screen(screen); - return QPointF(w->physicalDpiX(), w->physicalDpiY()); + const QScreen *screen = QDesktopWidgetPrivate::screen(screenNumber); + return QPointF(screen->physicalDotsPerInchX(), screen->physicalDotsPerInchY()); } #endif |