mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:10:06 +00:00
Resource Explorer view and model cleanup
This commit is contained in:
parent
06e33001f7
commit
f47fab196e
4 changed files with 4 additions and 4 deletions
|
|
@ -139,7 +139,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||||
// Configure Docks
|
// Configure Docks
|
||||||
ui->resourceExplorerDock->setVisible(false);
|
ui->resourceExplorerDock->setVisible(false);
|
||||||
|
|
||||||
ui->resourceTreeView->setModel(new model::RadarProductModel());
|
ui->resourceTreeView->setModel(new model::RadarProductModel(this));
|
||||||
|
|
||||||
// Configure Map
|
// Configure Map
|
||||||
p->ConfigureMapLayout();
|
p->ConfigureMapLayout();
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@
|
||||||
<string>Resource Explorer</string>
|
<string>Resource Explorer</string>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="dockWidgetArea">
|
<attribute name="dockWidgetArea">
|
||||||
<number>8</number>
|
<number>2</number>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QWidget" name="dockWidgetContents">
|
<widget class="QWidget" name="dockWidgetContents">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const std::shared_ptr<TreeItem> RadarProductModel::root_item() const
|
||||||
RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
|
RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
|
||||||
self_ {self},
|
self_ {self},
|
||||||
rootItem_ {std::make_shared<TreeItem>(
|
rootItem_ {std::make_shared<TreeItem>(
|
||||||
std::vector<QVariant> {QObject::tr("Name"), QObject::tr("Info")})}
|
std::vector<QVariant> {QObject::tr("Product")})}
|
||||||
{
|
{
|
||||||
connect(
|
connect(
|
||||||
&manager::RadarProductManagerNotifier::Instance(),
|
&manager::RadarProductManagerNotifier::Instance(),
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ QModelIndex TreeModel::parent(const QModelIndex& index) const
|
||||||
static_cast<const TreeItem*>(index.constInternalPointer());
|
static_cast<const TreeItem*>(index.constInternalPointer());
|
||||||
const TreeItem* parentItem = childItem->parent_item();
|
const TreeItem* parentItem = childItem->parent_item();
|
||||||
|
|
||||||
if (parentItem == root_item().get())
|
if (parentItem == root_item().get() || parentItem == nullptr)
|
||||||
{
|
{
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue