| 189 | } |
| 190 | |
| 191 | bool InstanceList::setData(const QModelIndex& index, const QVariant& value, int role) |
| 192 | { |
| 193 | if (!index.isValid()) { |
| 194 | return false; |
| 195 | } |
| 196 | if (role != Qt::EditRole) { |
| 197 | return false; |
| 198 | } |
| 199 | BaseInstance* pdata = static_cast<BaseInstance*>(index.internalPointer()); |
| 200 | auto newName = value.toString(); |
| 201 | if (pdata->name() == newName) { |
| 202 | return true; |
| 203 | } |
| 204 | pdata->setName(newName); |
| 205 | return true; |
| 206 | } |
| 207 | |
| 208 | Qt::ItemFlags InstanceList::flags(const QModelIndex& index) const |
| 209 | { |