PDA

View Full Version : TreeView / WidgetView



schall_l
22nd July 2009, 14:49
Hi,

I have a conceptual question:

I would like to create an application which layout could be somehow compared to the layout of iTunes: my main window is composed by a tree on the let side and by a widget (or a widget container) on the right side.

By selecting an item on the tree I would like to display the widget corresponding to the item selected on the right side. Is is convenient for me to store the item attributes (name, associated widget,...) directly in the treeItem class.

I was thinking to use a QSplitter between the tree and the widget to be displayed.
With QSplitter I can add or insert a Widget but I cannot replace one (In my case I would like to replace the widget on the right size when a different item is selected on the tree).

I was thinking to use a widget container on the right size of the splitter, but I am not sure what kind (if there is one) of Qt class could be used for this purpose.

Alternativelly I was also thinking to use a QtabWidget on the right size of the splitter, in order to put event and add all possible widget as tabs, but this solution just felt not to be the correct one.

If someone has an idea...

spirit
22nd July 2009, 15:03
take a look at QStackedWidget.