Patrick Sorcery
3rd September 2010, 03:56
Hello. I'm meeting a problem & I'll try my best to describe...
I decide to organize my objects in a tree structure and show them in a QTreeWidget, so I put a QStandardItem as a member in each class, use a QStandardItemModel to manage them and then use QTreeView::setModel() to show them in a QTreeView.
But now I want to get the pointer of the object which is currently selected and I don't know how... it seems QTreeView doesn't have a method to get current item, and even if it has I don't know how to get the object's pointer from the item's pointer...
BTW, what's the difference between QTreeView & QTreeWidget? I'm totally new in GUI making...
Thanx!
I decide to organize my objects in a tree structure and show them in a QTreeWidget, so I put a QStandardItem as a member in each class, use a QStandardItemModel to manage them and then use QTreeView::setModel() to show them in a QTreeView.
But now I want to get the pointer of the object which is currently selected and I don't know how... it seems QTreeView doesn't have a method to get current item, and even if it has I don't know how to get the object's pointer from the item's pointer...
BTW, what's the difference between QTreeView & QTreeWidget? I'm totally new in GUI making...
Thanx!