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

QMainWindow:restoreState doesnt restore width of QDockWidgets in maximized QMainWindow

    XMLWordPrintable

Details

    • 32edae5e268b968aff82f0713612eff2feffb4e1 (qt/qtbase/dev)
    • UI Bug Fixing Q1/2021

    Description

      This most probably relates to QTBUG-16252 but is slightly different and easy to reproduce.

      When saving the state of a mainwindow with a dockwidget in it, it will, on the next start, resize the dockwidgets at max only to a width which is the max available width of the dockwidget when the mainwindow was in normal state.

      The example project creates a mainwindow with a left dockwidget.

      Steps to reproduce:

      1. Compile and start (pic1.png)
      2. Maximize the App (pic2.png), resize the dockwidget (pic3.png) and close it
      3. Reopen the App and notice the wrong width of the qdockwidget (pic4.png)
      4. If you un-maximize the window you'll also notice that the width the qdockwidget had taken was the one which was at max available in this normal state (pic5.png).

      If you resize the app a bit wider and repeat the steps you'll see that the dockwidget gets also resized a bit wider.

      In my understanding the dockwidget has to be restored to the same size as it was when closing the app in the maximized state.

      Attachments

        1. DockWidgetTest.pro
          0.1 kB
        2. main.cpp
          1 kB
        3. pic1.png
          pic1.png
          16 kB
        4. pic2.png
          pic2.png
          41 kB
        5. pic3.png
          pic3.png
          42 kB
        6. pic4.png
          pic4.png
          44 kB
        7. pic5.png
          pic5.png
          13 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-46620
          # Subject Branch Project Status CR V

          Activity

            People

              vhilshei Volker Hilsheimer
              adrian2k Adrian Jäkel
              Votes:
              10 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes