PDA

View Full Version : Should I develop my own model and view?



dandanch
20th November 2006, 00:27
Hi, I am trying to develop a table-like view of a data structure. The data structure can be abstracted as:
Vector<Item>;

while Item is a composite of several other subitems.
Item {
Vector<Item1>;
Vector<Item2>;
Vector<Item3>;
}

For each subitem, there are different attributes in it.
Item 1 {
L1,
L2,
L3
}

Item 2 {
X,
Y,
Z
}

Item 3 {
u,
v
}

I need display all these Items and subitems and their attributes in a table view, the problem is how the horizontal header of the table should be set.
I want to use the header to show which attribute, which subitem and which itemType each column is.
Can someone familiar with the model/view philosophy of QT help me decide if this is a new view or I can still use the QTableView class.

Thanks a lot!!!

wysota
20th November 2006, 06:09
IMO you can use standard views and for example QStandardItemModel. You can organise it as a tree (items, subitems, attributes) or just as a flat table where subitems occupy columns before items and these are before attributes. I don't exactly know how do you want the headers to look like, if you could for example post an image, it could be easier for us to understand what you require.