summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmdiarea.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-08-13 15:19:20 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-08-18 13:10:23 +0000
commit23697466cae8f1a49537fed1e60db8cea79207b4 (patch)
treede527385caf854ddd810b39369370c8730c5306e /src/widgets/widgets/qmdiarea.cpp
parent52ad5afe1c1d8f8d47fccbdf474f8c6119b94608 (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/widgets/qmdiarea.cpp')
-rw-r--r--src/widgets/widgets/qmdiarea.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 31d9ae21ae..43158fa1fd 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -168,6 +168,7 @@
#include <QFontMetrics>
#include <QStyleOption>
#include <QDesktopWidget>
+#include <private/qdesktopwidget_p.h>
#include <QDebug>
#include <qmath.h>
#include <private/qlayoutengine_p.h>
@@ -1746,7 +1747,7 @@ QSize QMdiArea::sizeHint() const
}
const int scaleFactor = 3 * (nestedCount + 1);
- QSize desktopSize = QApplication::desktop()->size();
+ QSize desktopSize = QDesktopWidgetPrivate::size();
QSize size(desktopSize.width() * 2 / scaleFactor, desktopSize.height() * 2 / scaleFactor);
for (QMdiSubWindow *child : d_func()->childWindows) {
if (!sanityCheck(child, "QMdiArea::sizeHint"))