From 23697466cae8f1a49537fed1e60db8cea79207b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 13 Aug 2017 15:19:20 +0200 Subject: Reduce usage of QDesktopWidget to resolve screen properties in QtWidgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Simon Hausmann Reviewed-by: Tor Arne Vestbø --- src/widgets/graphicsview/qgraphicsview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets/graphicsview') 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 #include #include +#include #include #include #include @@ -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(); } -- cgit v1.2.3