diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-08-13 15:19:20 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-08-18 13:10:23 +0000 |
commit | 23697466cae8f1a49537fed1e60db8cea79207b4 (patch) | |
tree | de527385caf854ddd810b39369370c8730c5306e /src/widgets/graphicsview | |
parent | 52ad5afe1c1d8f8d47fccbdf474f8c6119b94608 (diff) |
Reduce usage of QDesktopWidget to resolve screen properties in QtWidgets
Removes the need to initialize QDesktopWidget, just to look up which
screen a widget would map to, the geometry of a screen, number of
screens, etc.
Change-Id: Ieb153b9ff6d3fba645fc528d6e430e8392f990bf
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 4b7890e9ff..1cc8543fdd 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -284,6 +284,7 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime < #include <QtCore/qscopedvaluerollback.h> #include <QtWidgets/qapplication.h> #include <QtWidgets/qdesktopwidget.h> +#include <private/qdesktopwidget_p.h> #include <QtGui/qevent.h> #include <QtWidgets/qlayout.h> #include <QtGui/qtransform.h> @@ -1248,7 +1249,7 @@ QSize QGraphicsView::sizeHint() const if (d->scene) { QSizeF baseSize = d->matrix.mapRect(sceneRect()).size(); baseSize += QSizeF(d->frameWidth * 2, d->frameWidth * 2); - return baseSize.boundedTo((3 * QApplication::desktop()->size()) / 4).toSize(); + return baseSize.boundedTo((3 * QDesktopWidgetPrivate::size()) / 4).toSize(); } return QAbstractScrollArea::sizeHint(); } |