Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.2, 6.8.0
-
-
a8df17436 (dev), 4253b2b6e (6.6), 36465be5c (tqtc/lts-6.5), 32578a088 (dev), d90987601 (dev), 3ca0288aa (dev), 800d7138a (6.8), 20fbd3440 (6.8), 9f79ffe8f (6.8)
Description
Hello,
We ran into a bug with QHeaderView::resetDefaultSize.
For some back story, we have a table view that displays a list of parameters. As a configuration setting, users can switch between different parameter page "densities" / row height to show more or less parameters for a given view size.
We can achieve this by toggling the value we use when calling QHeaderView::setDefaultSectionSize on the vertical header for this view to a "smaller" value in order to achieve a more "Compact" density and a smaller row height.
However, when we "reset" the view back to defaults using resetDefaultSectionSize, the view doesn't automatically update the row height like we expect.
Going default -> compact via setDefaultSectionSize works and updates.
But going back from compact -> default via resetDefaultSectionSize doesn't.
We're thinking it's likely related to invalidating the size hints here:
https://github.com/qt/qtbase/blob/af457a9f0f7eb1a2a7d11f495da508faab91a442/src/widgets/itemviews/qheaderview.cpp#L3878
Which doesn't seem to occur when resetting.
Attached is a motivating example which illustrates the bug.
If you click the "Apply Workaround" checkbox, you can apply our workaround to the bug (which resets, then calls setDefaultSectionSize followed by another reset)
Thanks,
Ryan
Attachments
Issue Links
- resulted in
-
QTBUG-122109 QTreeWidget's columns do not seem to resize properly after upgrading from Qt6.5.3 to Qt6.1.1
- Closed
-
QTBUG-123154 Applying stylesheet resets column and row size configurations on Qt 6.5.4
- Closed