mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:10:04 +00:00 
			
		
		
		
	Enable/disable layer move buttons according to selection
This commit is contained in:
		
							parent
							
								
									ec2663aee6
								
							
						
					
					
						commit
						b45ec9dfa5
					
				
					 3 changed files with 77 additions and 1 deletions
				
			
		|  | @ -164,6 +164,18 @@ Qt::DropActions LayerModel::supportedDropActions() const | |||
|    return Qt::DropAction::MoveAction; | ||||
| } | ||||
| 
 | ||||
| bool LayerModel::IsMovable(int row) const | ||||
| { | ||||
|    bool movable = false; | ||||
| 
 | ||||
|    if (0 <= row && static_cast<std::size_t>(row) < p->layers_.size()) | ||||
|    { | ||||
|       movable = p->layers_.at(row).movable_; | ||||
|    } | ||||
| 
 | ||||
|    return movable; | ||||
| } | ||||
| 
 | ||||
| QVariant LayerModel::data(const QModelIndex& index, int role) const | ||||
| { | ||||
|    static const QString enabledString  = QObject::tr("Enabled"); | ||||
|  |  | |||
|  | @ -43,6 +43,8 @@ public: | |||
|    Qt::ItemFlags   flags(const QModelIndex& index) const override; | ||||
|    Qt::DropActions supportedDropActions() const override; | ||||
| 
 | ||||
|    bool IsMovable(int row) const; | ||||
| 
 | ||||
|    QVariant data(const QModelIndex& index, | ||||
|                  int                role = Qt::DisplayRole) const override; | ||||
|    QVariant headerData(int             section, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat