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

incorrect mapToGlobal in Qt 5.15



    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Fixed
    • Affects Version/s: 5.14.0, 5.15.0 RC2
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
    • Environment:
      Windows 10; visual studio 15, qt 5.15.0
    • Platform/s:


      this appears to be a windows issue only.

      i have an MDI application (each subwindow contains a widget derived from QGLWidget) that has worked fine with Qt4 and Qt5 all the way up to Qt 5.12. recently, i updated to 5.15.0 and now i am running into the following issue (this issue is there in 5.14 as well):

      first of all everything works fine for the first subwindow created. the second and all subsequent subwindows when i call mapToGlobal the resulting QPoint is incorrect . as a test i called mapToGlobal with a QPoint(0,0) to get the location of the origin of the subwindow and it appears to be shifted to the right and down; each subsequent window is further shifted from the one previous.

      i have also noticed the following warning on creation of the second and subsequent subwindows (not sure if this is related to the incorrect window origin):

      QWindowsWindow::setGeometry: Unable to set geometry 1342x942+0+0 (frame: 1342x942+0+0) on QWidgetWindow/"QGLWidgetClassWindow" on "\.\DISPLAY1". Resulting geometry 1342x942+12+8 (frame: 1342x942) margins: 0, 0, 0, 0)

      i tried setMinimumSize and setGeometry on both the QGLWidget and the subwindow but i could not remove this warning.

      if anyone knows about this issue and a possible workaround or any ideas i would appreciate any help.


      to help i am attaching a zip file with a simple example that will reproduce the issue. notice that when starting the application on the second creation of the subwindow the warnings are issued.

      as the mouse is moved in the tabs the origin of the window is printed via QDebug. when the 2nd tab is activated then u will notice that its origin is incorrect by a factor of two; both tabs should have the same origin. even in non-tabbed mode this error seems to be there.



        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            thiago Thiago Macieira
            sawarsi Saif Warsi
            0 Vote for this issue
            1 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes