PDA

View Full Version : object hierarchy



Midek
10th May 2010, 11:49
Hello,
I need to display object hierarchy (3 level deep) on the different part of screen. For example on the first part (maybe qListWidged) i click on the car item. On the second part i get list of brands of cars (Vw, Audi, Bmw ..). Then a can click on the brand and on the third part on the screen i get list of car types given brand.

My question is, how model this data and than display it in simplest way? Hierarchy of list of object? Or the is some template for this in Qt? Maybe use QStandartItem class?

Thank

wysota
10th May 2010, 12:09
Create a tree model and three views (lists or tables) and then show different levels of your model in each of the views.

Midek
10th May 2010, 12:16
I wanted to avoid tree model and view, it seems to me to be too complicated for such thing, isn't something more simpler..?

tbscope
10th May 2010, 12:25
Actually, it's not that difficult.

See the simple tree model example:
http://doc.qt.nokia.com/4.6/itemviews-simpletreemodel.html

wysota
10th May 2010, 12:28
You can do everything manually if you want, if that's simpler to you.