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

    • fb69a09a2490102ad0c3f6015e04942bb5df7505 (qtbase/5.6, 28.11.2015, 5.6)

      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")
      

        1. qtbug48396_windows_verbose_log.txt
          2 kB
          Friedemann Kleint
        2. qtbug48396.zip
          2 kB
          Friedemann Kleint
        3. qtbug48396_widget_attrs_log.txt
          3 kB
          Friedemann Kleint
        4. qtbug48396.diff
          0.5 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes