Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
6.5.4, 6.6.2
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"