From f32cb71ed544026569b516031e8df152240cf399 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 28 Aug 2015 22:55:25 +0900 Subject: [PATCH] Clean up MyTreeWidget item editing --- gui/qt/util.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gui/qt/util.py b/gui/qt/util.py index bd2e8863e..b441db482 100644 --- a/gui/qt/util.py +++ b/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):