mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
task item has basic implementation
This commit is contained in:
parent
f6f779e127
commit
3a139256ac
1 changed files with 13 additions and 2 deletions
|
|
@ -170,8 +170,19 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
new_child = AssetItem(data)
|
||||
return self.add_item(new_child, parent)
|
||||
|
||||
def add_new_task(self, parent):
|
||||
pass
|
||||
def add_new_task(self, source_index):
|
||||
item_id = source_index.data(IDENTIFIER_ROLE)
|
||||
item = self.items_by_id[item_id]
|
||||
|
||||
if not isinstance(item, AssetItem):
|
||||
return None
|
||||
|
||||
name = "task"
|
||||
parent = item.parent()
|
||||
|
||||
data = {"name": name}
|
||||
new_child = TaskItem(data)
|
||||
return self.add_item(new_child, parent)
|
||||
|
||||
def add_new_item(self, parent):
|
||||
data = {"name": "Test {}".format(parent.childCount())}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue