| 169 | } |
| 170 | |
| 171 | bool InstanceList::setData(const QModelIndex& index, const QVariant& value, int role) |
| 172 | { |
| 173 | if (!index.isValid()) |
| 174 | { |
| 175 | return false; |
| 176 | } |
| 177 | if(role != Qt::EditRole) |
| 178 | { |
| 179 | return false; |
| 180 | } |
| 181 | BaseInstance *pdata = static_cast<BaseInstance *>(index.internalPointer()); |
| 182 | auto newName = value.toString(); |
| 183 | if(pdata->name() == newName) |
| 184 | { |
| 185 | return true; |
| 186 | } |
| 187 | pdata->setName(newName); |
| 188 | return true; |
| 189 | } |
| 190 | |
| 191 | Qt::ItemFlags InstanceList::flags(const QModelIndex &index) const |
| 192 | { |