From f47fab196ec177eb0b3b744c5fc00acfae75a5e3 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 22 Sep 2022 00:09:23 -0500 Subject: [PATCH] Resource Explorer view and model cleanup --- scwx-qt/source/scwx/qt/main/main_window.cpp | 2 +- scwx-qt/source/scwx/qt/main/main_window.ui | 2 +- scwx-qt/source/scwx/qt/model/radar_product_model.cpp | 2 +- scwx-qt/source/scwx/qt/model/tree_model.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index ce5db8a9..f28a9688 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -139,7 +139,7 @@ MainWindow::MainWindow(QWidget* parent) : // Configure Docks ui->resourceExplorerDock->setVisible(false); - ui->resourceTreeView->setModel(new model::RadarProductModel()); + ui->resourceTreeView->setModel(new model::RadarProductModel(this)); // Configure Map p->ConfigureMapLayout(); diff --git a/scwx-qt/source/scwx/qt/main/main_window.ui b/scwx-qt/source/scwx/qt/main/main_window.ui index a0ac0a3a..f5f1c23e 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.ui +++ b/scwx-qt/source/scwx/qt/main/main_window.ui @@ -230,7 +230,7 @@ Resource Explorer - 8 + 2 diff --git a/scwx-qt/source/scwx/qt/model/radar_product_model.cpp b/scwx-qt/source/scwx/qt/model/radar_product_model.cpp index e29e9e72..bb4ecebd 100644 --- a/scwx-qt/source/scwx/qt/model/radar_product_model.cpp +++ b/scwx-qt/source/scwx/qt/model/radar_product_model.cpp @@ -40,7 +40,7 @@ const std::shared_ptr RadarProductModel::root_item() const RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) : self_ {self}, rootItem_ {std::make_shared( - std::vector {QObject::tr("Name"), QObject::tr("Info")})} + std::vector {QObject::tr("Product")})} { connect( &manager::RadarProductManagerNotifier::Instance(), diff --git a/scwx-qt/source/scwx/qt/model/tree_model.cpp b/scwx-qt/source/scwx/qt/model/tree_model.cpp index fc2c823f..e2be6382 100644 --- a/scwx-qt/source/scwx/qt/model/tree_model.cpp +++ b/scwx-qt/source/scwx/qt/model/tree_model.cpp @@ -132,7 +132,7 @@ QModelIndex TreeModel::parent(const QModelIndex& index) const static_cast(index.constInternalPointer()); const TreeItem* parentItem = childItem->parent_item(); - if (parentItem == root_item().get()) + if (parentItem == root_item().get() || parentItem == nullptr) { return QModelIndex(); }