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

QMainWindow::restoreDockWidget will not restore a floating dock window to a secondary monitor screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.0
    • 4.8.6, 5.3.1
    • Widgets: Main Window
    • None
    • Dell XPS 8700 running Windows 7 64-bit (Build 7601: Service Pack 1) with two side by side 1920 x 1200 monitors. Qt is the latest 5.3.1.0 prebuilt libraries acquired using the Qt Maintenance tool.
    • 616469bb760fc7f751b3fc103f3584f14d3e2d0d (dev, 24.7.2014, 5.4)

    Description

      On systems that use two monitors (side by side), where the screen space is set up to be a continuous coordinate system, QMainWindow::restoreDockWidget will not restore a floating dock widget to the secondary window.

      This issue can be reproduced by using and modifying the example application code provided in QTBUG-16252. If the code is used as-is, where QMainWindow::restoreState restores the dock windows to their positions, the issue does NOT exist. For example, you can run the application and leave its main window open on the primary screen, float one of the two dock windows and move it to the secondary screen, then stop and restart the application, and the floating dock window is correctly repositioned and sized on the secondary screen.

      To reproduce the problem, modify the QTBUG-16252 example code so that the two dock widgets are created after the readSettings() call, and add calls to QMainWindow::restoreDockWidget for each. Try the same steps as above and the dock window that was moved to the secondary window will be restored back to the primary window instead of its previous place on the secondary window.

      Attachments

        1. qtbug40155_diag5.diff
          2 kB
          Friedemann Kleint
        2. qtbug40155_log.txt
          1.0 kB
          Friedemann Kleint
        3. qtbug40155.zip
          3 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              gbwarren Gary Warren
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes