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

QWidget::RestoreGeometry does not work if saveGeometry() is called while a widget is maximized [regression]

    XMLWordPrintable

Details

    • Qt 4: 54865d47cfd859a0e84ba8e1bbff3b56c93d4e0d, Qt 4 fixup abba37cd0eff959edf2d011842cbf2b36cce8467 (NOT merged), Qt 5 fixup ae4243df1e53b0aaeada708f6fa7979a0f0d216a (dev 12.2.2014, 5.3), 5edb71c6d (dev), fe4955c2f (6.5)

    Description

      I've discovered a bug with QWidget::restoreGeometry: if the restored geometry includes WindowMaximized and the window being restored to is already maximized, then the window gets resized to a non-maximized size, but behaves as if it was maximized (i.e. unable to resize the window; maximized window button appears as maximized).

      I've included a small example that demonstrates the problem. When you run it you will have two top-level windows - maximise the one labelled "Test Window" by pressing the window maximize button in the title bar (or double clicking the title), then on the one titled Control Panel, press Save Geometry followed by Restore Geometry. You will now find that the Test Window is back to it's original size, but is un-resizable.

      This example worked in version 4.4.3.

      Attachments

        1. newfix.cpp
          0.2 kB
        2. newfix2.cpp
          0.2 kB
        3. patch.diff
          0.6 kB
        4. qtbug4397.zip
          2 kB
        5. restoreGeometryBug.zip
          1 kB

        Issue Links

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

          Activity

            People

              axelspoerl Axel Spoerl
              xcm Martin Petersson (Inactive)
              Votes:
              16 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes