mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:10:05 +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
 | ||||
|    ui->resourceExplorerDock->setVisible(false); | ||||
| 
 | ||||
|    ui->resourceTreeView->setModel(new model::RadarProductModel()); | ||||
|    ui->resourceTreeView->setModel(new model::RadarProductModel(this)); | ||||
| 
 | ||||
|    // Configure Map
 | ||||
|    p->ConfigureMapLayout(); | ||||
|  |  | |||
|  | @ -230,7 +230,7 @@ | |||
|     <string>Resource Explorer</string> | ||||
|    </property> | ||||
|    <attribute name="dockWidgetArea"> | ||||
|     <number>8</number> | ||||
|     <number>2</number> | ||||
|    </attribute> | ||||
|    <widget class="QWidget" name="dockWidgetContents"> | ||||
|     <layout class="QVBoxLayout" name="verticalLayout_3"> | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ const std::shared_ptr<TreeItem> RadarProductModel::root_item() const | |||
| RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) : | ||||
|     self_ {self}, | ||||
|     rootItem_ {std::make_shared<TreeItem>( | ||||
|        std::vector<QVariant> {QObject::tr("Name"), QObject::tr("Info")})} | ||||
|        std::vector<QVariant> {QObject::tr("Product")})} | ||||
| { | ||||
|    connect( | ||||
|       &manager::RadarProductManagerNotifier::Instance(), | ||||
|  |  | |||
|  | @ -132,7 +132,7 @@ QModelIndex TreeModel::parent(const QModelIndex& index) const | |||
|       static_cast<const TreeItem*>(index.constInternalPointer()); | ||||
|    const TreeItem* parentItem = childItem->parent_item(); | ||||
| 
 | ||||
|    if (parentItem == root_item().get()) | ||||
|    if (parentItem == root_item().get() || parentItem == nullptr) | ||||
|    { | ||||
|       return QModelIndex(); | ||||
|    } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat