Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.9.4
-
None
-
gentoo linux with kde5, qt 5.9.4, kernel 4.15.0
This problem only appers in qt 5.9.4, not found in 5.9.3 and 5.10.1
Description
// code placeholder
The column width is reset when I sort the row.
Run below code, then change column width, then click HorizontalHeader to sort . column will be reset to default.
Code:
#include <QApplication> #include <QTableView> #include <QStandardItem> #include <QStandardItemModel> int main(int argc, char *argv[]) { QApplication a(argc, argv); QTableView view; QStandardItemModel model; model.setHorizontalHeaderItem(0, new QStandardItem(QObject::tr("Column 1"))); model.setHorizontalHeaderItem(1, new QStandardItem(QObject::tr("Column 2"))); model.setItem(0, 0, new QStandardItem("a")); model.setItem(0, 1, new QStandardItem("b")); view.setModel(&model); view.setSortingEnabled(true); view.show(); return a.exec(); }
Attachments
Issue Links
- duplicates
-
QTBUG-65478 Sorting changes table view column sizes
- Closed