Fix : conductor don't display well user defined variable as conductor text

see : https://qelectrotech.org/forum/viewtopic.php?pid=18835#p18835
This commit is contained in:
joshua 2023-10-16 22:24:18 +02:00
parent 4ce67bb532
commit 73c0848fcd
2 changed files with 7 additions and 20 deletions

View File

@ -94,9 +94,13 @@ Diagram::Diagram(QETProject *project) :
pen.setColor(Qt::black);
conductor_setter_ -> setPen(pen);
connect(&border_and_titleblock,
&BorderTitleBlock::informationChanged,
this, &Diagram::diagramInformationChanged);
connect(&border_and_titleblock, &BorderTitleBlock::informationChanged, this, [this]() {
for (auto conductor : content().conductors()) {
conductor->refreshText();
}
emit diagramInformationChanged();
});
connect(&border_and_titleblock,
&BorderTitleBlock::needTitleBlockTemplate,
this, &Diagram::setTitleBlockTemplate);
@ -109,9 +113,6 @@ Diagram::Diagram(QETProject *project) :
connect(&border_and_titleblock,
&BorderTitleBlock::borderChanged,
this, &Diagram::adjustSceneRect);
connect(&border_and_titleblock,
&BorderTitleBlock::titleBlockFolioChanged,
this, &Diagram::updateLabels);
connect(this, &Diagram::diagramActivated,
this, &Diagram::loadElmtFolioSeq);
connect(this, &Diagram::diagramActivated,
@ -1762,19 +1763,6 @@ void Diagram::invertSelection()
emit selectionChanged();
}
/**
@brief Diagram::updateLabels
Update elements and conductors that reference folio field
in their labels.
*/
void Diagram::updateLabels()
{
for (Conductor *cnd : content().conductors())
{
cnd->refreshText();
}
}
/**
@brief Diagram::insertFolioSeqHash
This class inserts a stringlist containing all

View File

@ -264,7 +264,6 @@ class Diagram : public QGraphicsScene
void titleBlockTemplateRemoved(const QString &,
const QString & = QString());
void setTitleBlockTemplate(const QString &);
void updateLabels();
void loadElmtFolioSeq();
void loadCndFolioSeq();