Browse Source

Clean up MyTreeWidget item editing

283
Neil Booth 9 years ago
parent
commit
f32cb71ed5
  1. 6
      gui/qt/util.py

6
gui/qt/util.py

@ -326,12 +326,10 @@ class MyTreeWidget(QTreeWidget):
if column is None:
column = self.edit_column
if column==self.edit_column and item.isSelected():
text = unicode(item.text(column))
key = str(item.data(0, Qt.UserRole).toString())
self.is_edit = True
item.setFlags(Qt.ItemIsEditable|Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | Qt.ItemIsEnabled | Qt.ItemIsDragEnabled)
item.setFlags(item.flags() | Qt.ItemIsEditable)
self.editItem(item, column)
item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | Qt.ItemIsEnabled | Qt.ItemIsDragEnabled)
item.setFlags(item.flags() & ~Qt.ItemIsEditable)
self.is_edit = False
def label_changed(self, item, column):

Loading…
Cancel
Save