English 中文(简体)
• 如何计算高通量。 QHeaderView:Resize ToContents for invisible rows/columns
原标题:How to calculate QTableView row height. QHeaderView::ResizeToContents for invisible rows/columns

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。 但这不足以使这个物体计算出正确的项目面积。

任何关于计算细胞高度的最佳方法的想法?

问题回答

奥克文,我已经补充了QTableView:sizeHintForRow()。 体积的计算方式与原始方法相同,但为此目的,我不得不在观察方法和其他情况下,先采用QStyleOptionViewItemV4。

你们是否有更好的解决办法?





相关问题
Table cell stretching

I have two columns in my table with equal width (50%, 50%). I am showing search results URL in them. For big urls the columns are stretching and destroying the layout. Any suggestion to the problem?

Add Semicolon to each value (each line) in a cell

I have the following values in a single cell let be A1 1234 567 454 Likewise all the A(N) are filled with values. N various from 1000 to 1500 I want this to get converted as 1234;567;454 Any ...

Blank when NaN in jqGrid cells

How to set blank instead of NaN in jqGrid cells ? Using formatter ? Is there an example?

BeginEdit of a specific Cell from code behind

Is possibile begin edit of a specific cell from code behind with DataGrid control (WPF Toolkit)? I have to enable the celledittemplate of first cell of selected row after a button action...how can I ...

提供数据

我想让浏览头和一栏头目从使用因特网部分数据GridView的图像中获得一个习俗背景。 甚至有可能这样做吗? 如果是,如何?

热门标签