[Interest] QTableView behavior; word wrapping plus rows resize to content

Bernhard Lindner private at bernhard-lindner.de
Fri Dec 14 02:21:33 CET 2018


Hi!

I am using a QTableView with word wrapping enabled and rows configured to resize to
content automatically.

Is it desired behavior that the view a does NOT update the row height when columns are
manually resized in a way that a cell changes from single-line to double-line text (or
vice versa)?

The following line solves the problem:

CHECK_TRUE(connect(ui->tableView->horizontalHeader(), SIGNAL(sectionResized(int, int,
int)), ui->tableView, SLOT(resizeRowsToContents())));

However it seems strange that the above does not work out of the box. Is that behaviour a
bug?

-- 
Best Regards, 
Bernhard




More information about the Interest mailing list