python - pyqt QTreeWidgetItem double click connect -


is possible connect doubleclick event qtreewidgetitem?

something this:

def test(self):         print("hello")  childitem = qtreewidgetitem()    childitem.doubleclicked.connect(self.test) 

the signal want called itemdoubleclicked , belongs qtreewidget itself:

from pyqt4 import qtgui  def handler(item, column_no):     print(item, column_no)  def main():     app = qtgui.qapplication(sys.argv)     win = qtgui.qtreewidget()      items = [qtgui.qtreewidgetitem("item: {}".format(i)) in xrange(10)]     win.inserttoplevelitems(0, items)     win.itemdoubleclicked.connect(handler)      win.show()     sys.exit(app.exec_())  if __name__ == '__main__':     main() 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -