commit f32cb71ed544026569b516031e8df152240cf399 parent 351272f0b6f8f253483ea6913fcc8c5932a16378 Author: Neil Booth <kyuupichan@gmail.com> Date: Fri, 28 Aug 2015 22:55:25 +0900 Clean up MyTreeWidget item editing Diffstat:
M | gui/qt/util.py | | | 6 | ++---- |
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git 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):