mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
always expand parent of moved item
This commit is contained in:
parent
eb6ece6422
commit
7c78a9a584
1 changed files with 16 additions and 3 deletions
|
|
@ -183,16 +183,29 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
self.edit(new_index)
|
||||
|
||||
def _on_up_ctrl_pressed(self):
|
||||
self._source_model.move_horizontal(self.currentIndex(), -1)
|
||||
index = self.currentIndex()
|
||||
self._source_model.move_horizontal(index, -1)
|
||||
parent_index = index.parent()
|
||||
if not self.isExpanded(parent_index):
|
||||
self.expand(parent_index)
|
||||
|
||||
def _on_down_ctrl_pressed(self):
|
||||
self._source_model.move_horizontal(self.currentIndex(), 1)
|
||||
index = self.currentIndex()
|
||||
self._source_model.move_horizontal(index, 1)
|
||||
parent_index = index.parent()
|
||||
if not self.isExpanded(parent_index):
|
||||
self.expand(parent_index)
|
||||
|
||||
def _on_left_ctrl_pressed(self):
|
||||
self._source_model.move_vertical(self.currentIndex(), -1)
|
||||
|
||||
def _on_right_ctrl_pressed(self):
|
||||
self._source_model.move_vertical(self.currentIndex(), 1)
|
||||
index = self.currentIndex()
|
||||
self._source_model.move_vertical(index, 1)
|
||||
|
||||
parent_index = index.parent()
|
||||
if not self.isExpanded(parent_index):
|
||||
self.expand(parent_index)
|
||||
|
||||
def _on_enter_pressed(self):
|
||||
index = self.currentIndex()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue