| 69 | } |
| 70 | |
| 71 | void PathModel::copy(const QPersistentModelIndex& itemIndex) noexcept { |
| 72 | int index = itemIndex.data(Qt::EditRole).toInt(); |
| 73 | if ((index >= 0) && (index < mPath.getVertices().count())) { |
| 74 | beginInsertRows(QModelIndex(), index, index); |
| 75 | mPath.insertVertex(index, mPath.getVertices().value(index)); |
| 76 | endInsertRows(); |
| 77 | emit pathChanged(mPath); |
| 78 | } else { |
| 79 | qWarning() << "Invalid index in PathModel::copyItem():" << index; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | void PathModel::remove(const QPersistentModelIndex& itemIndex) noexcept { |
| 84 | int index = itemIndex.data(Qt::EditRole).toInt(); |
no test coverage detected