I have an item in the qtreewidget that when selected displays text in another widget. When I do a save on that text, it updates the file on the remote system and the local data file, but when the qtreeview is cleared and rebuilt, my selected item is obviously no longer selected. How do I ensure the previously selected item is selected once I do the clear? I think the method I need is currentItemChanged. Here's the code I'm working with:
def on_treeWidget_iRulesList_currentItemChanged(self, currentItem, previousItem): x = currentItem.text(0) y = previousItem.text(0) print x, y When I first click an item, I get an error on the y = line that NoneType object has no attribute 'text'. Once I select something else, however, I get the text I expect. When I do a refresh of the qtreewidget list, I get the error again, only on the x = line. Any ideas how I can fix this? Thanks, Jason
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt