create new folder added

This commit is contained in:
itsmattkc
2019-07-05 11:04:23 -05:00
parent dae4310a7e
commit bc631c495d
10 changed files with 170 additions and 39 deletions
+15
View File
@@ -376,6 +376,21 @@ bool ProjectViewModel::dropMimeData(const QMimeData *data, Qt::DropAction action
return false;
}
void ProjectViewModel::AddChild(Item *parent, Item *child)
{
QModelIndex parent_index;
if (parent != project_->root()) {
parent_index = CreateIndexFromItem(parent);
}
beginInsertRows(parent_index, parent->child_count(), parent->child_count());
parent->add_child(child);
endInsertRows();
}
int ProjectViewModel::IndexOfChild(Item *item) const
{
// Find parent's index within its own parent