PDA

View Full Version : QTableView 2 rows inside every row



skuda
20th April 2009, 19:40
Hello,
i need to create a tableview where in every row you can see an information for
the complete row but later to define the units for every size make a division
inside the row, like this:


Header: Model | Description | Price | Size / Qty
ROW: 15415 | Beautiful Shoes | 15.50 | 9.5 10 9
SAME ROW: | | | 5 3 0


I dont know how represent this exactly with chars but i think you can see the
idea, the row should have a height bigger than normal to contain the division
and the columns Model, Description and Price should be Center aligned in the
row. The size should be header like but i suppose i can get the effect simply
changing the colors.

What would be the better way to do this with qt? Thanks.

Regards,
Miguel Angel.

ChrisW67
21st April 2009, 03:28
Looks like you want a QTreeView and a model that returns the secondary row information as a row with a parent pointing at the primary row. Certainly where I'd start to look.

aamer4yu
21st April 2009, 05:23
Ya probably you could opt for QTreeView as said above.
Or you can choose delegates. You will need to draw yourself, and you can divide the area as you like :)

skuda
22nd April 2009, 09:23
I would like to see all in the same row, i will try with delegates and if i dont get the result i want i will try with treeview, thanks to both for the suggestions.