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

QMainWindow::restoreState shows removed dockwidgets.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some future release
    • 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.7.0, 6.8.1
    • Widgets: Main Window
    • None
    • GNU/Linux

    Description

      If you remove a dockwidget by calling QMainWindow::removeDockWidget(), saving and then restoring it again will make the removed dock widget reappear again. Please take a look at the attached example.

      To reproduce:
      1. File->"Remove dock X"
      2. File->"Save State"
      3. File->"Restore State"

      Additional description:

      Dock widgets that have been removed from the main window by calling removeDockWidget() (or those that have never been added, likewise) must not be docked implicitly by calling restoreState(), or strange effects will occur if one of these widgets currently is in an invalid state. The only way I found circumventing this is destroying those widgets before calling restoreState() and recreating them afterwards, which also is not what I want to do, because then their layout is not restored at all. restoreState() should just do what the name of the method implies: Restore the state of the dock widgets, i.e. dock area, tabbed status etc., but it must not add them to the QMainWindow automatically.

      Attachments

        1. bug.tar.bz2
          2 kB
        2. patch.diff
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            stromme Christian
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes