diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-16 20:43:34 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-06-08 20:29:49 +0200 |
commit | 44fb925f50471ebc23dcccfaa4e9d9873b05d205 (patch) | |
tree | e4e212052b66242ff94aa98f6df7b15dbeb945f7 /examples | |
parent | a061a646429c6e9d695458fc0ecb0021a30e12ee (diff) | |
download | qtbase-44fb925f50471ebc23dcccfaa4e9d9873b05d205.tar.gz |
Phase 2 of removing QDesktopWidget
Remove QDestopWidget public header, simplify the implementation that
maintains a Qt::Desktop type QWidget for each QScreen, and turn
QWidget's initial target screen into a QScreen pointer.
QApplication::desktop() now takes an optional QScreen pointer, and
returns a QWidget pointer, so that applications and widgets can get
access to the root widget for a specific screen without having to
resort to private APIs.
QDesktopWidgetPrivate implementations to look up a screen for an index,
widget, or point are now all inline functions that thinly wrap
QGuiApplication::screens/screenAt calls. We should consider adding those
as convenience APIs to QScreen instead.
Note that QWidget::screen is assumed to return a valid pointer; there is
code that handles the case that it returns nullptr (but also code that
trusts that it never is nullptr), so this needs to be defined, verified
with tests, and asserted. We can then simplify the code further.
Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/opengl/hellogl2/main.cpp | 1 | ||||
-rw-r--r-- | examples/opengl/hellogl2/window.cpp | 1 | ||||
-rw-r--r-- | examples/widgets/painting/deform/pathdeform.cpp | 1 | ||||
-rw-r--r-- | examples/widgets/widgets/charactermap/mainwindow.cpp | 1 |
4 files changed, 0 insertions, 4 deletions
diff --git a/examples/opengl/hellogl2/main.cpp b/examples/opengl/hellogl2/main.cpp index b52a5a37d3..e0cffaf4c2 100644 --- a/examples/opengl/hellogl2/main.cpp +++ b/examples/opengl/hellogl2/main.cpp @@ -49,7 +49,6 @@ ****************************************************************************/ #include <QApplication> -#include <QDesktopWidget> #include <QSurfaceFormat> #include <QCommandLineParser> #include <QCommandLineOption> diff --git a/examples/opengl/hellogl2/window.cpp b/examples/opengl/hellogl2/window.cpp index 5534f2edea..169f5e59c5 100644 --- a/examples/opengl/hellogl2/window.cpp +++ b/examples/opengl/hellogl2/window.cpp @@ -56,7 +56,6 @@ #include <QHBoxLayout> #include <QKeyEvent> #include <QPushButton> -#include <QDesktopWidget> #include <QApplication> #include <QMessageBox> diff --git a/examples/widgets/painting/deform/pathdeform.cpp b/examples/widgets/painting/deform/pathdeform.cpp index 9ddc6ea12b..acf0191260 100644 --- a/examples/widgets/painting/deform/pathdeform.cpp +++ b/examples/widgets/painting/deform/pathdeform.cpp @@ -60,7 +60,6 @@ #include <QPainter> #include <QSlider> #include <QLabel> -#include <QDesktopWidget> #include <qmath.h> PathDeformControls::PathDeformControls(QWidget *parent, diff --git a/examples/widgets/widgets/charactermap/mainwindow.cpp b/examples/widgets/widgets/charactermap/mainwindow.cpp index 47f7001a34..1bab0d6082 100644 --- a/examples/widgets/widgets/charactermap/mainwindow.cpp +++ b/examples/widgets/widgets/charactermap/mainwindow.cpp @@ -55,7 +55,6 @@ #include <QBoxLayout> #include <QCheckBox> #include <QClipboard> -#include <QDesktopWidget> #include <QDialog> #include <QDialogButtonBox> #include <QFontComboBox> |