diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-05 14:19:06 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-18 10:15:26 +0200 |
commit | eed9a8fbd300dafb2802b6c09c018fbda4e13ef1 (patch) | |
tree | f7dd03d516d76be452336c1c086438ade2544b40 /src/widgets/widgets/qmainwindowlayout.cpp | |
parent | cd563b3497a608a91794a7a086e5fbf248e77998 (diff) |
Add accessors for QWindow and QScreen to QWidgetPrivate
Rewrite the existing accessor QWidgetPrivate::windowHandle() to
accept a mode enumeration that has an "Any" convenience.
Based on that, add QWidgetPrivate::associatedScreen(), which is seful
in many places where scaling is performed.
Prototypically simplify the code.
Task-number: QTBUG-62094
Task-number: QTBUG-73231
Change-Id: I516288363d329bce9bc94e4951106f9357bc6cde
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index f54835f23b..b8f997b782 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -2584,9 +2584,9 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) } } for (QWidget *w : candidates) { - QWindow *handle1 = widget->windowHandle(); - QWindow *handle2 = w->windowHandle(); - if (handle1 && handle2 && handle1->screen() != handle2->screen()) + const QScreen *screen1 = qt_widget_private(widget)->associatedScreen(); + const QScreen *screen2 = qt_widget_private(w)->associatedScreen(); + if (screen1 && screen2 && screen1 != screen2) continue; if (!w->geometry().contains(mousePos)) continue; |