Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.9.4
-
None
Description
(Related to QTBUG-66413. Since we switched to Qt 5.9.4 we have several major issues in our trees and tables, we caught them in our unit tests and squish tests.)
We have a model with no row, and several columns. Some of the columns are hidden. The view is sorting on one of the visible columns. If a reset of the model is triggered all the hidden columns become visible again even though there is no change in the number of columns.
The reset triggers an update of the sorting, _q_layoutAboutToBeChanged is called and clears layoutChangePersistentSections. Then when q_layoutChanged is called the visibility cannot be restored.
As noted in the comment inside _q_layoutAboutToBeChanged the fact that the design relies on indices of the first row is problematic.
LayoutChangeItem {
QPersistentModelIndex index; // cannot have one on a model with no row
SectionItem section;
};
I attached a test demonstrating the issue.
Attachments
Issue Links
- is duplicated by
-
QTBUG-66519 [REG] QTableView::setSortingEnabled breaks setColumnWidth
-
- Closed
-
-
QTBUG-66572 RestoreState with qtableWidget no longer works
-
- Closed
-
-
QTBUG-68262 Calling sortByColumn() on a view with proxy model set resets header section settings
-
- Closed
-
- relates to
-
QTBUG-66413 QHeaderView: Sorting loses the hidden section sizes
-
- Closed
-
For Gerrit Dashboard: QTBUG-66444 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
220567,5 | QHeaderView: Preserve settings on layoutChange with empty model | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |
221199,2 | QHeaderView: Preserve settings on layoutChange with empty model | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |