mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
added few checks
This commit is contained in:
parent
9a0203bd9e
commit
6b940ae6bf
1 changed files with 5 additions and 2 deletions
|
|
@ -253,8 +253,9 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
else:
|
||||
event.accept()
|
||||
|
||||
def _delete_item(self):
|
||||
index = self.currentIndex()
|
||||
def _delete_item(self, index=None):
|
||||
if index is None:
|
||||
index = self.currentIndex()
|
||||
self._source_model.remove_index(index)
|
||||
|
||||
def _on_ctrl_shift_enter_pressed(self):
|
||||
|
|
@ -294,6 +295,8 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
new_index = self._source_model.add_new_asset(index)
|
||||
if new_index is None:
|
||||
return
|
||||
|
||||
# Change current index
|
||||
self.setCurrentIndex(new_index)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue