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

QMainWindow::restoreState() changes orientation of dock widgets which have not been there when the state was saved

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 4.8.5, 5.5.1, 5.8.0
    • Widgets: Main Window
    • None
    • Qt 4.8.3 on Ubuntu Quantal using Unity
      and
      Qt 4.8.5 on OS X
      and
      Qt 5.5.1 on Ubuntu Xenial using Unity
    • macOS

    Description

      A main window containing dock widgets can store the state and restore it next time with the same widgets.
      But if there are new dock widgets available compared to when the state was stored their orientation is overwritten by QMainWindow::restoreState().

      I create a minimal example which shows the issue.
      The following steps will reproduce the issue:

      • build the application (e.g. using CMake)
      • start application
      • click "add horizontal"
      • click "add horizontal"
      • click "add vertical"
      • click "add horizontal"
        ... the layout will look like this:
        11 22 44
        33333 44
      • click "save state"
      • close application
      • start application
      • click "add vertical" 5 times
        ... the layout will look like this:
        11
        22
        33
        44
        55
      • click "restore state"
        ... the layout will look like this:
        11 22 44 55
        33333 44 55

      BUT since 5 was not known before I would expect its orientation
      (vertical) to not change by the restoreState invocation
      ... the layout should look like this:
      11 22 44
      33333 44
      55555555

      Attachments

        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
            dirk-thomas Dirk Thomas
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes