Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-48396

REG [4-5]: QWidget::mapToGlobal(0, 0) returns QPoint(0, 0) in ShowEvent for toplevels in some cases

    XMLWordPrintable

Details

    • 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

          For Gerrit Dashboard: QTBUG-48396
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes