if no uuid for the terminal is available, use write the id of the terminal to the xml file, otherwise no connection can be done after saving

This commit is contained in:
Martin Marmsoler
2020-10-02 14:58:33 +02:00
parent 9684d753ec
commit c8691b243b
4 changed files with 40 additions and 4 deletions

View File

@@ -77,6 +77,7 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
Diagram *diagram () const;
Element *parentElement () const;
QUuid uuid () const;
int ID() const;
QPointF dockPos();
QPointF originPos();
@@ -90,6 +91,7 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
void updateConductor();
bool isLinkedTo(Terminal *);
bool canBeLinkedTo(Terminal *);
void setID(int id);
// methods related to XML import/export
static bool valideXml(const QDomElement &);
@@ -151,6 +153,9 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
/// Number of Terminal
QString number_terminal_;
bool name_terminal_hidden{true};
/// legacy id used by the conductor to find the terminal. From 0.8x on the uuid is used instead.
int m_id{-1};
private:
void init(QString number, QString name, bool hiddenName);