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

Empty window appears when calling QMainWindow::restoreState()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.6.2, 5.7.0
    • Fix Version/s: 5.9.0 Beta 2
    • Component/s: Widgets: Main Window
    • Labels:
      None
    • Commits:
      461549c35ade73b3c048e2c5ecfbd412c438c026

      Description

      When restoring state Qt will restore dock widgets, some of them can be in a QDockWidgetGroupWindow.

      Qt however won't create the actual dock widgets, it's expected that the user opens them before calling restoreState(). If the user calls restoreState() before opening the dock widgets an empty QDockWidgetGroupWindow is created, which has no tabs and can't be closed.

      To reproduce:

      • Open qtbase/examples/widgets/mainwindows/mainwindow
      • Main window -> Enable groupped dragging (in the menu)
      • Dock Widgets -> Add Dock Widget (call it foo)
      • Dock Widgets -> Add Dock Widget (call it bar)
      • Make foo and bar float, drop bar on top of foo, you now have a window with two tabs
      • File -> Save Layout
      • Close app
      • Start app again, and File -> Load Layout

      You now see a window which you can't close

        Attachments

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

          Activity

            People

            • Assignee:
              iamsergio Sergio Martins
              Reporter:
              iamsergio Sergio Martins
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes