mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
implemented delete_add_asset_item to remove AddAssetItem
This commit is contained in:
parent
8493274f5c
commit
1dd406722f
1 changed files with 14 additions and 0 deletions
|
|
@ -488,6 +488,20 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
if item.data(REMOVED_ROLE):
|
||||
item.setData(False, REMOVED_ROLE)
|
||||
|
||||
def delete_add_asset_item(self, parent):
|
||||
item = parent.add_asset_item
|
||||
children = parent.children()
|
||||
if item not in children:
|
||||
return
|
||||
parent_index = self.index_for_item(parent)
|
||||
row = children.index(item)
|
||||
|
||||
self.beginRemoveRows(parent_index, row, row)
|
||||
|
||||
parent.remove_child(item)
|
||||
|
||||
self.endRemoveRows()
|
||||
|
||||
def delete_index(self, index):
|
||||
return self.delete_indexes([index])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue