diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index 0f944510..f603fcc6 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -148,6 +148,7 @@ MainWindow::MainWindow(QWidget* parent) : ui->resourceExplorerDock->setVisible(false); p->radarProductModel_ = std::make_shared(); + ui->resourceTreeView->setModel(p->radarProductModel_->model()); // Configure Map p->ConfigureMapLayout(); diff --git a/scwx-qt/source/scwx/qt/model/tree_model.cpp b/scwx-qt/source/scwx/qt/model/tree_model.cpp index 313fa6dc..af8998ad 100644 --- a/scwx-qt/source/scwx/qt/model/tree_model.cpp +++ b/scwx-qt/source/scwx/qt/model/tree_model.cpp @@ -191,9 +191,19 @@ void TreeModel::AppendRow(TreeItem* parent, TreeItem* child) const int first = childCount; const int last = childCount; + if (parent == p->rootItem_.get()) + { + beginResetModel(); + } + beginInsertRows(parentIndex, first, last); parent->AppendChild(child); endInsertRows(); + + if (parent == p->rootItem_.get()) + { + endResetModel(); + } } const TreeItem* TreeModelImpl::item(const QModelIndex& index) const