Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.2
-
None
-
8bde410a6d0b1510d182a365d769db182b1c07dd
Description
A row in a QTableView won't resize to the correct height (ie for word wrapping) if the visible column order is changed so the logicalIndex of the rightmost column is less than the logicalIndex of the leftmost column.
void tst_QTableView::sizeHintForRow_on_moved_rows
{
QTableView tableView;
QStandardItemModel model;
model.setColumnCount(3);
model.setRowCount(1);
model.setData(model.index(0, 0), "Word wrapping text goes here.");
tableView.setModel(&model);
tableView.verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
int orderedHeight = tableView.verticalHeader()->sectionSize(0);
tableView.horizontalHeader()->moveSection(2, 0);
tableView.resizeRowsToContents();
int reorderedHeight = tableView.verticalHeader()->sectionSize(0);
QCOMPARE(orderedHeight == reorderedHeight);
}