diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-03-24 09:31:28 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-04-09 08:30:12 +0000 |
commit | 56d091a4ea0276a4af732bfc8c701f392e57b9a1 (patch) | |
tree | 76e7dad76c13f6b9061cc9429fd1d81d0da1061b /src/widgets | |
parent | d984b07221f55ccb8b531e6184a6fb361c324139 (diff) |
QToolButton: Fix popup menu geometry in case of QGraphicsProxyWidget.
QDesktopWidget::availableGeometry(const QWidget *) returns the scene
geometry when the widget is embedded into a QGraphicsProxyWidget.
Work around by using the overload taking a point.
Task-number: QTBUG-38559
Change-Id: Ie630bda57e14648255015587a04e29b0de96bab7
Reviewed-by: Arnaud Bienner <arnaud.bienner@gmail.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qtoolbutton.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp index 1efe88acde..5a56c592a6 100644 --- a/src/widgets/widgets/qtoolbutton.cpp +++ b/src/widgets/widgets/qtoolbutton.cpp @@ -733,9 +733,9 @@ void QToolButtonPrivate::popupTimerDone() horizontal = false; #endif QPoint p; - QRect screen = QApplication::desktop()->availableGeometry(q); + const QRect rect = q->rect(); // Find screen via point in case of QGraphicsProxyWidget. + QRect screen = QApplication::desktop()->availableGeometry(q->mapToGlobal(rect.center())); QSize sh = ((QToolButton*)(QMenu*)actualMenu)->receivers(SIGNAL(aboutToShow()))? QSize() : actualMenu->sizeHint(); - QRect rect = q->rect(); if (horizontal) { if (q->isRightToLeft()) { if (q->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.height()) { |