I have QTableView with a little number of rows and about 10 columns. I set QHeaderView::ResizeToContents resizeMode for verticalHeader(). But it works only for visible rows. For example if the tableView is scrolled to right and some data have been changed, height of rows become smaller. And after tableView has been scrolled back, height of rows remains too small for cells, which were invisible before. I found that reimplementing of sizeHintForRow(int row) can solve the problem. But I can t find a good way to calculate height of cell (including invisible cells) using top level functions...
我可以使用原来的QTableView:sizeHintForRow()。 我只需要改变其中的一小部分。 但是,它称为“d->”;viewOptionsV4()。 我只能得到QStyleOptionViewItemV1。 但这不足以使这个物体计算出正确的项目面积。
任何关于计算细胞高度的最佳方法的想法?