mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:30:05 +00:00 
			
		
		
		
	Separating tree model from radar product model
This commit is contained in:
		
							parent
							
								
									782d61e5f0
								
							
						
					
					
						commit
						1ab0d62b1f
					
				
					 7 changed files with 182 additions and 79 deletions
				
			
		|  | @ -16,9 +16,15 @@ class TreeModelImpl; | |||
| class TreeModel : public QAbstractItemModel | ||||
| { | ||||
| public: | ||||
|    explicit TreeModel(QObject* parent = nullptr); | ||||
|    explicit TreeModel(const std::vector<QVariant>& headerData, | ||||
|                       QObject*                     parent = nullptr); | ||||
|    explicit TreeModel(std::initializer_list<QVariant> headerData, | ||||
|                       QObject*                        parent = nullptr); | ||||
|    virtual ~TreeModel(); | ||||
| 
 | ||||
|    const TreeItem* root_item() const; | ||||
|    TreeItem*       root_item(); | ||||
| 
 | ||||
|    int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||||
|    int columnCount(const QModelIndex& parent = QModelIndex()) const override; | ||||
| 
 | ||||
|  | @ -33,8 +39,12 @@ public: | |||
|                        const QModelIndex& parent = QModelIndex()) const override; | ||||
|    QModelIndex   parent(const QModelIndex& index) const override; | ||||
| 
 | ||||
| protected: | ||||
|    virtual const std::shared_ptr<TreeItem> root_item() const = 0; | ||||
|    bool insertRows(int row, int count, const QModelIndex& parent) override; | ||||
|    bool setData(const QModelIndex& index, | ||||
|                 const QVariant&    value, | ||||
|                 int                role = Qt::EditRole) override; | ||||
| 
 | ||||
|    void AppendRow(TreeItem* parent, TreeItem* child); | ||||
| 
 | ||||
| private: | ||||
|    friend class TreeModelImpl; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat