I need to do some action when an element in a QTreeWidget is activated, but the following code does not produce the expected result:
class MyWidget(QTreeWidget):
def __init__(self, parent=None):
super(MyWidget, self).__init__(parent)
self.connect(self, SIGNAL("activated(QModelIndex)"), self.editCell)
def editCell(self, index):
print index
or
class MyWidget(QTreeWidget):
def __init__(self, parent=None):
super(MyWidget, self).__init__(parent)
self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem, int)"),
self.editCell)
def editCell(self, item, column=0):
print item
What am I doing wrong or how to activate an element correctly?
Thanks in advance, Serge
serge source
share