PDA

View Full Version : QTableView with widgets



steg90
21st November 2007, 16:03
Hi,

I have a QTableView with four columns.

I use setIndexWidget to put the widgets into the various cells, thus in column one I have a QCheckBox, col 2 a QSlider, col 3 a QLineEdit and col 4 a QToolButton. All these are in the first row of the table. Now if I wanted to add another row would it be possible to use the widgets in row1 and put them into row2? How many of these widgets could I have before the table view would grind to a halt?!

Thanks,
Steve

wysota
21st November 2007, 22:41
No, you'd have to create another set of widgets.

How many widgets? Not many :)

Consider using a QScrollArea instead of the view.

steg90
22nd November 2007, 10:23
Hi,

QScrollArea? Can this act like a table or do I just add various widgets to the scroll area using setWidget?

Regards,
Steve

wysota
22nd November 2007, 10:56
If you add a header and program the whole thing to resize the widgets under it, I don't see a problem. Right now you are trying to use a table without items which doesn't make much sense and slows you down.

steg90
22nd November 2007, 11:20
Thanks for that,

So I'd have a QScrollView and place a QHeaderView inside it and then use headerData to supply the data for each section of the header?

Regards,
Steve

wysota
22nd November 2007, 11:46
Do whatever you want. QHeaderView is a very limited class - it's not even a view at all... Not everything might work there - but I wish you luck, this is a very interesting issue.