Boy
23rd June 2008, 14:21
I have a QTableWidget. I have the size for the width set to 600. But runtime I want to determine the height of it.
I don't know how many rows the table will have until it is constructed at runtime. I have been playing with adjustSize(), I've set the minimum size 600 x 20 (too small, I know), number of rows have been set (just for trying it out) in the Qt Designer on 2. But it just uses the sizeHint() and this one returns 256x256.
Now I found out that you need a layout to get it to take notice of the minimum size. So I just took a spacer and made a layout of it. this now works for the width (set sizepolicy for this on fixed) but the height is ignored.
What am I doing wrong? Anyone experience on this?
I don't know how many rows the table will have until it is constructed at runtime. I have been playing with adjustSize(), I've set the minimum size 600 x 20 (too small, I know), number of rows have been set (just for trying it out) in the Qt Designer on 2. But it just uses the sizeHint() and this one returns 256x256.
Now I found out that you need a layout to get it to take notice of the minimum size. So I just took a spacer and made a layout of it. this now works for the width (set sizepolicy for this on fixed) but the height is ignored.
What am I doing wrong? Anyone experience on this?