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

Empty window appears when calling QMainWindow::restoreState()

    XMLWordPrintable

Details

    • 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

            iamsergio Sergio Martins
            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