mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:40:05 +00:00 
			
		
		
		
	Fix radar product model display and refresh
This commit is contained in:
		
							parent
							
								
									f24aa78b50
								
							
						
					
					
						commit
						917926a0ec
					
				
					 2 changed files with 11 additions and 0 deletions
				
			
		|  | @ -148,6 +148,7 @@ MainWindow::MainWindow(QWidget* parent) : | ||||||
|    ui->resourceExplorerDock->setVisible(false); |    ui->resourceExplorerDock->setVisible(false); | ||||||
| 
 | 
 | ||||||
|    p->radarProductModel_ = std::make_shared<model::RadarProductModel>(); |    p->radarProductModel_ = std::make_shared<model::RadarProductModel>(); | ||||||
|  |    ui->resourceTreeView->setModel(p->radarProductModel_->model()); | ||||||
| 
 | 
 | ||||||
|    // Configure Map
 |    // Configure Map
 | ||||||
|    p->ConfigureMapLayout(); |    p->ConfigureMapLayout(); | ||||||
|  |  | ||||||
|  | @ -191,9 +191,19 @@ void TreeModel::AppendRow(TreeItem* parent, TreeItem* child) | ||||||
|    const int         first       = childCount; |    const int         first       = childCount; | ||||||
|    const int         last        = childCount; |    const int         last        = childCount; | ||||||
| 
 | 
 | ||||||
|  |    if (parent == p->rootItem_.get()) | ||||||
|  |    { | ||||||
|  |       beginResetModel(); | ||||||
|  |    } | ||||||
|  | 
 | ||||||
|    beginInsertRows(parentIndex, first, last); |    beginInsertRows(parentIndex, first, last); | ||||||
|    parent->AppendChild(child); |    parent->AppendChild(child); | ||||||
|    endInsertRows(); |    endInsertRows(); | ||||||
|  | 
 | ||||||
|  |    if (parent == p->rootItem_.get()) | ||||||
|  |    { | ||||||
|  |       endResetModel(); | ||||||
|  |    } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const TreeItem* TreeModelImpl::item(const QModelIndex& index) const | const TreeItem* TreeModelImpl::item(const QModelIndex& index) const | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat