QTreeWidget activate item signals
Posted
by serge
on Stack Overflow
See other posts from Stack Overflow
or by serge
Published on 2010-04-14T16:23:55Z
Indexed on
2010/04/14
19:23 UTC
Read the original article
Hit count: 385
Hi everyone,
I need to do some actions when item in QTreeWidget activates, but following code doestn't gives me 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 hadnle item activation in the right way?
Thanks in advance, Serge
© Stack Overflow or respective owner