diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index 4b93571b0..38ac170b5 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1765,25 +1765,29 @@ void Conductor::setSequenceNum(const autonum::sequentialNumbers& sn) */ void Conductor::setUpConnectionForFormula(QString old_formula, QString new_formula) { - if (diagram()) + Diagram *diagram_ {diagram()}; + if (!diagram_) { + diagram_ = terminal1->diagram(); + } + if (diagram_) { //Because the variable %F is a reference to another text which can contain variables, //we must replace %F by the real text, to check if the real text contains the variable %id if (old_formula.contains("%F")) - old_formula.replace("%F", diagram()->border_and_titleblock.folio()); + old_formula.replace("%F", diagram_->border_and_titleblock.folio()); if (old_formula.contains("%id")) - disconnect(diagram()->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); + disconnect(diagram_->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); //Label is frozen, so we don't update it. if (m_freeze_label == true) return; if (new_formula.contains("%F")) - new_formula.replace("%F", diagram()->border_and_titleblock.folio()); + new_formula.replace("%F", diagram_->border_and_titleblock.folio()); if (new_formula.contains("%id")) - connect(diagram()->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); + connect(diagram_->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); } } diff --git a/sources/qetgraphicsitem/conductortextitem.cpp b/sources/qetgraphicsitem/conductortextitem.cpp index a4bbcd8b9..2e9cf0f10 100644 --- a/sources/qetgraphicsitem/conductortextitem.cpp +++ b/sources/qetgraphicsitem/conductortextitem.cpp @@ -251,7 +251,6 @@ void ConductorTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) { void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) { Q_UNUSED(e); - qDebug() << "Leave mouse over"; m_mouse_hover = false; update(); }