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

Floating QDockWidgets not dockable after QMainWindow::restoreState

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.0.1
    • Widgets: Main Window
    • None
    • Windows 7 64-Bit, MinGW 4.7 32-Bit that ships with Qt5.0.1

      A floating QDockWidget is not dockable after the QMainWindow state has been restores from QSettings file via QMainWindow::restoreState() in QMainWindow constructor.

      Do the following steps to reproduce the error:

      1. Build and run the attached modified dockwidgets example wit Qt 5.0.1

      2. Undock one dockwidget and make it floating

      3. Select the menu item View -> Save Window State

      4. Close the application

      5. Restart the application

      Now it is not posssible to dock the floating dockwidget. If I restore the state via the menu item View -> Restore Window State this does not happen. So it seems to be related to the fact the restoreState() is called in the QMainWindow constructor when the window is not visible yet.

      In Qt4.8.4 this code works.

        1. dockwidgets.zip
          16 kB
        2. qtbug30514.tar
          10 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            ukindler Uwe Kindler
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes