diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-14 23:40:34 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-16 04:44:13 +0200 |
commit | 215594d664f6fc7057468a05a59344f08a78a976 (patch) | |
tree | c2c31c30383e4090c6da0f31a4fcf1ca098a769c /src/widgets/kernel/qapplication.cpp | |
parent | ef1905aebc4c4961c859bd781398dc6cea89d3a0 (diff) |
Purge QDesktopWidget
It's no longer used; the only calls to QApplicationPrivate::desktop
pass the default nullptr for QScreen, so all we need is a Qt::Desktop
type toplevel widget.
Include changes documentation about both the class and QApplication::desktop
being gone in Qt 6.
Change-Id: I22d6e93cabc6aaaefffe5e96942886a2ef4e0609
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 41b3dd9aca..ed6414b16f 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -42,7 +42,6 @@ #include "qapplication.h" #include "qclipboard.h" #include "qcursor.h" -#include "qdesktopwidget_p.h" #include "qdir.h" #include "qevent.h" #include "qfile.h" @@ -378,7 +377,7 @@ FontHash *qt_app_fonts_hash() { return app_fonts(); } QWidgetList *QApplicationPrivate::popupWidgets = nullptr; // has keyboard input focus -QDesktopWidget *qt_desktopWidget = nullptr; // root window widgets +QWidget *qt_desktopWidget = nullptr; // root window widgets /*! \internal @@ -2510,31 +2509,21 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) } /*! - \obsolete - - Returns the desktop widget (also called the root window) for \a screen. - - If \a screen is nullptr, then the widget that represents the entire virtual - desktop is returned, and its geometry will be the union of all screens. + \internal - Use the desktop widget for a specific screen as the parent of a new toplevel - widget to position the widget on a specific screen. + Returns the desktop widget (also called the root window). - The desktop may be composed of multiple screens, so it would be incorrect, - for example, to attempt to \e center some widget in the desktop's geometry. - Use QScreen::geometry() and QScreen::availableGeometry() to get the dimensions - of a specific screen instead. + The widget represents the entire virtual desktop, and its geometry will + be the union of all screens. */ -QWidget *QApplicationPrivate::desktop(QScreen *screen) +QWidget *QApplicationPrivate::desktop() { CHECK_QAPP_INSTANCE(nullptr) if (!qt_desktopWidget || // not created yet !(qt_desktopWidget->windowType() == Qt::Desktop)) { // reparented away - qt_desktopWidget = new QDesktopWidget(); + qt_desktopWidget = new QWidget(nullptr, Qt::Desktop); } - if (!screen) - return qt_desktopWidget; - return qt_desktopWidget->widgetForScreen(screen); + return qt_desktopWidget; } /* |