mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 10:30:53 +01:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user