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

QHeaderView does not restore its geometry based on what is saved.

    XMLWordPrintable

Details

    Description

      Reproducer attached. A QTableView with a QHeaderView as its vertical header is placed inside a QMainWindow. saveGeometry() and restoreGeometry() work well for almost all objects except QHeaderView. QHeaderView does not restoreGeometry() correctly based on what is saved by saveGeometry(). No matter how the width is changed, upon a restarting QHeaderView is always shown with a "default" width regardless. Saving and restoring state does not help either.

      I particularly recorded what are saved by saveGeometry and loaded by restoreGeometry. This is result from one test among many others.
      QTableView: saveGeometry (top) and restoreGeometry (bottom) match

      "\x01\xD9\xD0\xCB\x00\x03\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x04\xAC\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x01\x00\x00\x00\x00\n\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x04\xAC\x00\x00\x00\x18"
      "\x01\xD9\xD0\xCB\x00\x03\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x04\xAC\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x01\x00\x00\x00\x00\n\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x04\xAC\x00\x00\x00\x18"
      

      QHeaderView: saveGeometry (top) and restoreGeometry (bottom) mismatch

      "\x01\xD9\xD0\xCB\x00\x03\x00\x00\x00\x00\x00\x01\x00\x00\x00\x19\x00\x00\x00\x0F\x00\x00\x03\xB6\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x01\x00\x00\x00\x00\n\x00\x00\x00\x00\x01\x00\x00\x00\x19\x00\x00\x00\x0F\x00\x00\x03\xB6"
      "\x01\xD9\xD0\xCB\x00\x03\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x04\xAC\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x01\x00\x00\x00\x00\n\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x04\xAC\x00\x00\x00\x18"
      

      Attachments

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

        Activity

          People

            axelspoerl Axel Spoerl
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes