vastly improved multithreaded loading and annchor point gizmo

This commit is contained in:
itsmattkc
2018-12-15 00:09:14 +11:00
parent 2fa7a638d5
commit 7a2a2af8ec
15 changed files with 292 additions and 153 deletions
+8 -3
View File
@@ -19,15 +19,13 @@ void ProjectModel::destroy_root() {
if (panel_footage_viewer != NULL) panel_footage_viewer->viewer_widget->delete_function();
if (root_item != NULL) {
beginRemoveRows(QModelIndex(), 0, root_item->childCount());
delete root_item;
endRemoveRows();
}
}
void ProjectModel::clear() {
destroy_root();
beginResetModel();
destroy_root();
root_item = new Media(0);
root_item->root = true;
endResetModel();
@@ -132,6 +130,13 @@ Media *ProjectModel::getItem(const QModelIndex &index) const {
return root_item;
}
void ProjectModel::set_icon(Media* m, const QIcon &ico) {
QModelIndex index = createIndex(m->row(), 0, m);
m->set_icon(ico);
emit dataChanged(index, index);
}
void ProjectModel::appendChild(Media *parent, Media *child) {
if (parent == NULL) parent = root_item;
beginInsertRows(parent == root_item ? QModelIndex() : createIndex(parent->row(), 0, parent), parent->childCount(), parent->childCount());