Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.5.0, 5.6.0 Alpha
-
Windows, Linux
-
fb69a09a2490102ad0c3f6015e04942bb5df7505 (qtbase/5.6, 28.11.2015, 5.6)
Description
Calling Widget::mapToGlobal(0, 0) within ShowEvent returns QPoint(0, 0) for most cases (QDialog , QMenu set on QPushButton) as if the QWidget was at 0,0 itself.
This reproduces in the example with the menu on the toolbar button and the file dialog opened by "File/Open". It works for the MainWindow and the context menu of the QPlainTextEdit.
The example produces
"5.6.0 xcb" .... ### QEvent::Show MapToGlobalTest(0x7fff8d444b00) QWindow: QRect(500,300 640x480) vis= false window->mapToGlobal(0, 0)-> QPoint(500,300) QWidgets: QRect(500,300 256x243) widget->mapToGlobal(0, 0)-> QPoint(500,300) [*** Mainwindow:ok ***] QEvent::Show QWidgetWindow(0xfe4cc0, name = "MapToGlobalTestClassWindow") [*** Click on Button menu ***] QMoveEvent(513,347, non-spontaneous) QMenu(0xfd5ef0, name = "ButtonMenu") ### QEvent::Show QMenu(0xfd5ef0, name="ButtonMenu") QWindow: QRect(0,0 640x480) vis= false window->mapToGlobal(0, 0)-> QPoint(0,0) QWidgets: QRect(513,347 134x46) widget->mapToGlobal(0, 0)-> QPoint(0,0) [*** 0, 0 unexpected ***] QEvent::Show QWidgetWindow(0x10601d0, name = "ButtonMenuWindow")
Attachments
Issue Links
- relates to
-
QTBUG-49588 [REG 4.8->5.X] When programmatically opening a submenu of a context menu using QMenu::setActiveAction() before calling QMenu::exec(), it is shown at the wrong position
-
- Closed
-
- replaces
-
QTBUG-48387 Regression[4-5] mapToGlobal()
-
- Closed
-
For Gerrit Dashboard: QTBUG-48396 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
141859,5 | QWidget::mapTo/FromGlobal(): Avoid calling QWindow helpers until shown. | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |