diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-07-06 17:22:12 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-07-07 11:49:32 +0200 |
commit | 7e2fded55e67727043c3dd0a1a5b3883655101c4 (patch) | |
tree | e7ba2ab69ebe9077be9614f574f7f2dc1d375a79 /src/widgets/widgets/qmdiarea.cpp | |
parent | bcbc4d4de2d4d27f70fc56baf104d93b31d57061 (diff) |
Remove usage of QDesktopWidget(Private) from most places in QtWidgets
Call QGuiApplication and QScreen APIs directly to get geometries, and
make use of QScreen::grabWindow grabbing the screen it's called on when
called with WId == 0.
This assumes that QGuiApplication::screen and QWidget::screen never
return nullptr, which is already assumed in other places.
In QSplashScreen, simplify the code to operate on the screen of the
QSplashScreen itself. Remove the case that handles a QDesktopWidget
parent - QSplashScreen doesn't have a constructor that takes a
QWidget* parent anymore.
In the QEffect implementation, we can rely on the widget pointer
not being nullptr (it's tested in the free functions client code
uses).
Includes a few drive-by changes to coding style and logic in
qtooltip.cpp, where the tip label placement now prefers the screen
of the widget the label is created for, and uses the position only
as a fallback.
What remains is the special handling of QDesktopWidget and the
Qt::Desktop type in QWidget and QApplication.
Change-Id: I30b67bab8ae82ddfcc7bbbec3c10f6e935b74f06
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmdiarea.cpp')
-rw-r--r-- | src/widgets/widgets/qmdiarea.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index f2613bf5dd..c1913a3d09 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -165,7 +165,6 @@ #include <QPainter> #include <QFontMetrics> #include <QStyleOption> -#include <private/qdesktopwidget_p.h> #include <QDebug> #include <qmath.h> #if QT_CONFIG(menu) |