How can I add an additional function to take place when an item is expanded? Below I've attempted to re-implement the expandItem event but it doesn't appear to do anything. Why is that?
# QTreeWidgets
# ------------------------------------------------------------------------------
class FactionsTreeWidget( QtGui.QTreeWidget ):
def __init__(self, parent=None):
QtGui.QTreeWidget.__init__(self, parent)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
self.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.setItemsExpandable(True)
self.setAlternatingRowColors(True)
def itemExpanded( self, *args, **kwargs ):
res = super( self, my_class ).itemExpanded( *args, **kwargs )
print "expanding stuff..."
return res