[PyQt] selecting an item in qtreewidget
J.Rahm at F5.com
Tue May 3 23:00:40 BST 2011
I figured out the "itemClicked part"
Still not sure about auto-selecting the last item added to the tree. Any thoughts would be appreciated.
From: pyqt-bounces at riverbankcomputing.com [mailto:pyqt-bounces at riverbankcomputing.com] On Behalf Of Jason Rahm
Sent: Tuesday, May 03, 2011 2:27 PM
To: pyqt at riverbankcomputing.com
Subject: [PyQt] selecting an item in qtreewidget
Newbie question...I'm stuck on how to select an item in my qtreewidget. This loop populates my tree:
item = 
for item in allrules.keys():
hdr = QTreeWidgetItem([item])
x = 
for x in allrules[item]:
rule = QTreeWidgetItem(hdr, [x])
This is where I'm trying to set the current item, but I'm guessing it's empty since there isn't one already set?
selRule = self.treeWidget_iRulesList.currentItem()
How do I select the last item added, and how do I select one by clicking on it? Sorry to be so basic, I'm really trying to understand the syntax!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt