MCPcopy Create free account
hub / github.com/LibrePCB/LibrePCB / copy

Method copy

libs/librepcb/editor/modelview/pathmodel.cpp:71–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void 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
83void PathModel::remove(const QPersistentModelIndex& itemIndex) noexcept {
84 int index = itemIndex.data(Qt::EditRole).toInt();

Callers 1

cropImageMethod · 0.45

Calls 4

insertVertexMethod · 0.80
dataMethod · 0.45
countMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected