mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Bug fix: Paste element, make new uuid for the element.
In previous version, uuid are same whith copied and paste element. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2784 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -301,7 +301,12 @@ void PasteDiagramCommand::undo() {
|
||||
/// refait le coller
|
||||
void PasteDiagramCommand::redo() {
|
||||
diagram -> showMe();
|
||||
if (first_redo) first_redo = false;
|
||||
if (first_redo) {
|
||||
first_redo = false;
|
||||
//this is the first paste, we make new uuid for each element
|
||||
//because old uuid are the uuid of the copied element
|
||||
foreach(Element *e, content.elements) e->newUuid();
|
||||
}
|
||||
else {
|
||||
// paste the elements
|
||||
foreach(Element *e, content.elements) diagram -> addElement(e);
|
||||
|
||||
@@ -105,6 +105,8 @@ class Element : public QetGraphicsItem {
|
||||
virtual void unlinkElement(Element *elmt) {}
|
||||
void initLink(QETProject *);
|
||||
QList<Element *> linkedElements () const;
|
||||
//create new uuid for this element
|
||||
void newUuid() {uuid_ = QUuid::createUuid();}
|
||||
|
||||
/**
|
||||
Draw this element
|
||||
|
||||
Reference in New Issue
Block a user