diff options
author | Volodymyr Zibarov <gogan419@gmail.com> | 2022-04-11 23:52:51 +0300 |
---|---|---|
committer | Volodymyr Zibarov <gogan419@gmail.com> | 2022-04-22 21:11:12 +0300 |
commit | 7febf0b30e8a6d74f0d78b0e727c52d18672a991 (patch) | |
tree | 8a091d858e8cd9754b1b334488a66635c8c5d5cd /src/widgets/widgets/qpushbutton.cpp | |
parent | 72793ef31d4aae551aed2aaa6cc07fced67379f6 (diff) |
QGraphicsScene: Fix popup position for QGraphicsProxyWidget
screenGeometry() for proxy widget was returning visible part of the
scene instead of screen geometry for enclosing first view
Pass button center position to screenGeometry() to get correct screen
for cases when graphics view occupies two screens
Fixes: QTBUG-98785
Pick-to: 6.2 6.3
Change-Id: Idaeb3c3faf739751c93624a06fa0fd3d65388236
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/widgets/qpushbutton.cpp')
-rw-r--r-- | src/widgets/widgets/qpushbutton.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index cacc0f22d1..97650979e0 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -643,7 +643,7 @@ QPoint QPushButtonPrivate::adjustedMenuPosition() QPoint globalPos = q->mapToGlobal(rect.topLeft()); int x = globalPos.x(); int y = globalPos.y(); - const QRect availableGeometry = QWidgetPrivate::availableScreenGeometry(q); + const QRect availableGeometry = QWidgetPrivate::availableScreenGeometry(q, q->mapToGlobal(rect.center())); if (horizontal) { if (globalPos.y() + rect.height() + menuSize.height() <= availableGeometry.bottom()) { y += rect.height(); |