mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Minor fix : master XRef is not updated when variable %F is used
This commit is contained in:
parent
8f051fc612
commit
5912a99c16
@ -331,6 +331,7 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
|
||||
// through setFolioData(),
|
||||
// which in turn calls updateDiagramContextForTitleBlock().
|
||||
emit(needTitleBlockTemplate(ip.template_name));
|
||||
emit informationChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -245,6 +245,12 @@ class BorderTitleBlock : public QObject
|
||||
since it does not know of its parent project.
|
||||
*/
|
||||
void needTitleBlockTemplate(const QString &);
|
||||
|
||||
/**
|
||||
* @brief infoChanged
|
||||
* Signal emitted when the informations changed.
|
||||
*/
|
||||
void informationChanged();
|
||||
|
||||
// attributes
|
||||
private:
|
||||
|
@ -92,6 +92,9 @@ 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::needTitleBlockTemplate,
|
||||
this, &Diagram::setTitleBlockTemplate);
|
||||
|
@ -283,6 +283,7 @@ class Diagram : public QGraphicsScene
|
||||
void findElementRequired(const ElementsLocation &);
|
||||
|
||||
void diagramActivated();
|
||||
void diagramInformationChanged();
|
||||
};
|
||||
Q_DECLARE_METATYPE(Diagram *)
|
||||
|
||||
|
@ -128,6 +128,15 @@ void CrossRefItem::setUpConnection()
|
||||
m_update_connection << connect(m_element,
|
||||
&Element::linkedElementChanged,
|
||||
this, &CrossRefItem::linkedChanged);
|
||||
|
||||
auto diagram_ = dynamic_cast<Diagram *>(this->scene());
|
||||
auto formula_ = m_properties.masterLabel();
|
||||
if (diagram_ &&
|
||||
formula_.contains("%F"))
|
||||
{
|
||||
m_update_connection << connect(diagram_ , &Diagram::diagramInformationChanged,
|
||||
this, &CrossRefItem::updateLabel);
|
||||
}
|
||||
linkedChanged();
|
||||
updateLabel();
|
||||
}
|
||||
@ -161,13 +170,9 @@ QPainterPath CrossRefItem::shape() const{
|
||||
QString CrossRefItem::elementPositionText(
|
||||
const Element *elmt, const bool &add_prefix) const
|
||||
{
|
||||
XRefProperties xrp =
|
||||
m_element->diagram()->project()->defaultXRefProperties(
|
||||
m_element->kindInformations()["type"].toString());
|
||||
QString formula = xrp.masterLabel();
|
||||
autonum::sequentialNumbers seq;
|
||||
QString txt = autonum::AssignVariables::formulaToLabel(
|
||||
formula,
|
||||
m_properties.masterLabel(),
|
||||
seq, elmt->diagram(),
|
||||
elmt);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user