diff options
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 |