Conductor now support variables. (%F, %id, %total, %f and titleblock and project variables). Minor: labels that use %F update when folio field is changed

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4586 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
dfochi
2016-07-20 21:54:54 +00:00
parent 3a7d210bcb
commit 989905da01
5 changed files with 75 additions and 5 deletions

View File

@@ -78,6 +78,7 @@ Diagram::Diagram(QETProject *project) :
connect(&border_and_titleblock, SIGNAL(needTitleBlockTemplate(const QString &)), this, SLOT(setTitleBlockTemplate(const QString &)));
connect(&border_and_titleblock, SIGNAL(diagramTitleChanged(const QString &)), this, SLOT(titleChanged(const QString &)));
connect(&border_and_titleblock, SIGNAL(borderChanged(QRectF,QRectF)), this, SLOT(adjustSceneRect()));
connect(&border_and_titleblock, SIGNAL(titleBlockFolioChanged()), this, SLOT(updateLabels()));
adjustSceneRect();
}
@@ -1056,6 +1057,22 @@ void Diagram::invertSelection() {
emit(selectionChanged());
}
/**
* @brief Diagram::updateLabels
* Update elements and conductors that reference folio field
* in their labels.
*/
void Diagram::updateLabels() {
foreach (Element *elmt, elements()) {
if (elmt->elementInformations()["label"].toString().contains(("%F")))
elmt->updateLabel();
}
foreach (Conductor *cnd, content().conductors()) {
if (cnd->properties().text.contains("%F"))
cnd->setText(cnd->properties().text);
}
}
/**
@return le titre du cartouche
*/