PDA

View Full Version : Sample code to use QTreeWidget and QStackWidget



Jeff100
22nd December 2010, 05:26
Hello,

Could anyone show a sample code to use QTreeWidget and QStackWidget, or pointer a link which use such a combination. Basically when a QTreeWidgetItem in a QtreeWdiget is clicked in the left side, a coressponding QStackWidget will be shown on the right. Thanks.

tbscope
22nd December 2010, 09:05
Create a slot connected to the QTreeWidget::itemClicked signal.
In that slot, do your own checking if necessary and call the QStackedWidget::setIndex slot.