Merge pull request #3230 from pypeclub/enhancement/project_manager_without_persistent_editors

This commit is contained in:
Jakub Trllo 2022-05-26 18:53:20 +02:00 committed by GitHub
commit f1331da651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,6 +139,7 @@ class HierarchyView(QtWidgets.QTreeView):
self.setAlternatingRowColors(True)
self.setSelectionMode(HierarchyView.ExtendedSelection)
self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.setEditTriggers(HierarchyView.AllEditTriggers)
column_delegates = {}
column_key_to_index = {}
@ -301,16 +302,6 @@ class HierarchyView(QtWidgets.QTreeView):
def rowsInserted(self, parent_index, start, end):
super(HierarchyView, self).rowsInserted(parent_index, start, end)
for row in range(start, end + 1):
for key, column in self._column_key_to_index.items():
if key not in self.persistent_columns:
continue
col_index = self._source_model.index(row, column, parent_index)
if bool(
self._source_model.flags(col_index)
& QtCore.Qt.ItemIsEditable
):
self.openPersistentEditor(col_index)
# Expand parent on insert
if not self.isExpanded(parent_index):