PDA

View Full Version : Editing QTreeWidgetItems (PyQt4)



smhall316
26th July 2010, 20:15
I am having a hard time correctly editing a QTreeWidgetItem when setting the item to edit mode. What is the correct way to do this. I would like to make it editable and when the user enters text and presses enter then the item changes its name. If the user presses the escape key then all changes are ignored and the name goes back to the original name. I appreciate any help.

franz
27th July 2010, 06:14
Add the Qt.ItemIsEditable flag to the item flags. The other behavior is implemented by the QTreeView and its delegate.