mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-01 09:04:13 +02:00
Merge pull request #544 from DieterMayerOSS/fix/duplicate-folio-element-uuids
Renew element uuids when duplicating a folio
This commit is contained in:
@@ -643,6 +643,12 @@ void ElementsPanelWidget::duplicateDiagram()
|
|||||||
|
|
||||||
for (QGraphicsItem *item : new_diagram->items()) {
|
for (QGraphicsItem *item : new_diagram->items()) {
|
||||||
if (Element *elmt = dynamic_cast<Element *>(item)) {
|
if (Element *elmt = dynamic_cast<Element *>(item)) {
|
||||||
|
// The XML round-trip kept the source elements' uuids. Give the
|
||||||
|
// copies their own identity (as PasteDiagramCommand::redo()
|
||||||
|
// does for on-diagram paste): element.uuid is the PRIMARY KEY
|
||||||
|
// of the project database, so duplicates fail to insert and
|
||||||
|
// silently vanish from nomenclature/summary tables.
|
||||||
|
elmt->newUuid();
|
||||||
new_diagram->restoreText(elmt);
|
new_diagram->restoreText(elmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user