diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-13 21:02:39 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-14 18:10:16 +0200 |
commit | a8dd18252c4c8027e8c7956f3c5428b56014445b (patch) | |
tree | 8fb5b1e62c4158b56117df0ba3e688e4031e2fd1 | |
parent | 5c097f895d73a80c8ff5b401100e25c4b5f69eeb (diff) |
Remove QApplication::desktop
It's been replaced with QScreen-based APIs.
There's some internal code left
depending on a QWidget representing a screen, so move the API into
QApplicationPrivate until that's cleaned up as well.
Change-Id: I851e0901832f2747af3bf2c16a9c4d815598bd08
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index bb43812619..be37182ccd 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1567,7 +1567,7 @@ QWidget *QApplication::activeWindow() QFontMetrics QApplication::fontMetrics() { - return desktop()->fontMetrics(); + return QApplicationPrivate::desktop()->fontMetrics(); } bool QApplicationPrivate::tryCloseAllWidgetWindows(QWindowList *processedWindows) @@ -2107,7 +2107,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con if (!parentOfLeavingCursor->window()->graphicsProxyWidget()) #endif { - if (enter == QApplication::desktop()) { + if (enter == QApplicationPrivate::desktop()) { qt_qpa_set_cursor(enter, true); } else { qt_qpa_set_cursor(parentOfLeavingCursor, true); @@ -2522,7 +2522,7 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) Use QScreen::geometry() and QScreen::availableGeometry() to get the dimensions of a specific screen instead. */ -QWidget *QApplication::desktop(QScreen *screen) +QWidget *QApplicationPrivate::desktop(QScreen *screen) { CHECK_QAPP_INSTANCE(nullptr) if (!qt_desktopWidget || // not created yet diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index 36a7576c2d..52304c637a 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -105,8 +105,6 @@ public: static QWidgetList allWidgets(); static QWidgetList topLevelWidgets(); - static QWidget *desktop(QScreen *screen = nullptr); - static QWidget *activePopupWidget(); static QWidget *activeModalWidget(); static QWidget *focusWidget(); diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 354cac0c9a..c5c3f2f393 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -113,7 +113,7 @@ public: void createEventDispatcher() override; static void dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPointF &globalPosF); - + static QWidget *desktop(QScreen *screen = nullptr); void notifyWindowIconChanged() override; #ifndef QT_NO_ACTION |