Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
5.10.1
-
None
-
Windows 10, Visual Studio 2017
Description
I have a table view and a proxy model for sorting. Calling `sortByColumn()` on the view changes section resize mode on the header and section sizes.
This is a regression found when porting from Qt 5.6.2, where it worked correctly (the mode and section sizes didn't change).
Example code:
int main(int argc, char *argv[]) { QApplication a(argc, argv); QTableView tw; tw.show(); QStandardItemModel md; md.setColumnCount(1); QSortFilterProxyModel proxy; proxy.setSourceModel(&md); tw.setModel(&proxy); tw.horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed); qDebug() << tw.horizontalHeader()->sectionResizeMode(0); tw.sortByColumn(0); qDebug() << tw.horizontalHeader()->sectionResizeMode(0); return a.exec(); }
Debug output is:
QHeaderView::ResizeMode(Fixed) QHeaderView::ResizeMode(Interactive)
Attachments
Issue Links
- duplicates
-
QTBUG-66444 QHeaderView: Sorting loses the hidden section when the model has no rows
-
- Closed
-