Getting data from the inherited QTreeWidgetItem class
1 answer
You create and add an element:
newItem = new QTreeWidgetItem(myExplorer);
set data:
newItem->setData(myListWidgetItem::idType, 1234);
And you have a slot that accepts the clicked item (in the tree) that you can read the data:
connect( myExplorer, SIGNAL( itemClicked (QTreeWidgetItem *, int) ), this, SLOT( slotFillListWidget(QTreeWidgetItem *, int) ) );
+1
source to share