PDA

View Full Version : qtablewidget exposed lines



tuli
23rd August 2014, 16:10
Hi,


I have a QTableWidget that is being resized by the user. I need it to have as many rows as fit on the screen, without creating scrollbars.


For that i would need to calculate the number of rows exposed on the screen. I was unable to find a method for taht, so i did the following calculation:


(height - header.height) / rowheight


But the result is ... well, it works but it doesnt look very clean. is there a better or more official way?

wysota
25th August 2014, 12:47
In general rows can have different heights so unless you forbid resizing them. If you put a constraint on the size, then it will be easy for you to calculate what you need.