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/widgets/qtoolbutton.cpp | |
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/widgets/qtoolbutton.cpp')
-rw-r--r-- | src/widgets/widgets/qtoolbutton.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index f2c5814203..60c9c43399 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -41,6 +41,7 @@ #include <qapplication.h> #include <qdesktopwidget.h> +#include <private/qdesktopwidget_p.h> #include <qdrawutil.h> #include <qevent.h> #include <qicon.h> @@ -745,7 +746,7 @@ void QToolButtonPrivate::popupTimerDone() #endif QPoint p; const QRect rect = q->rect(); // Find screen via point in case of QGraphicsProxyWidget. - QRect screen = QApplication::desktop()->availableGeometry(q->mapToGlobal(rect.center())); + QRect screen = QDesktopWidgetPrivate::availableGeometry(q->mapToGlobal(rect.center())); QSize sh = ((QToolButton*)(QMenu*)actualMenu)->receivers(SIGNAL(aboutToShow()))? QSize() : actualMenu->sizeHint(); if (horizontal) { if (q->isRightToLeft()) { |