mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 10:30:53 +01:00
Added Cross Reference Labels for Master and Slave Element. Removed View Mode
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4511 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -91,16 +91,13 @@ QPainterPath CrossRefItem::shape() const{
|
||||
QString CrossRefItem::elementPositionText(const Element *elmt, const bool &add_prefix) const{
|
||||
|
||||
QString txt;
|
||||
XRefProperties::ViewMode vw = m_properties.viewMode();
|
||||
if (vw == XRefProperties::Index)
|
||||
{
|
||||
txt += QString::number(elmt->diagram()->folioIndex() + 1);
|
||||
}
|
||||
else if (vw == XRefProperties::FolioLabel){
|
||||
txt += elmt->diagram()->border_and_titleblock.folio();
|
||||
}
|
||||
txt += "-";
|
||||
txt += elmt->diagram()->convertPosition(elmt -> scenePos()).toString();
|
||||
XRefProperties xrp = m_element->diagram()->defaultXRefProperties(m_element->kindInformations()["type"].toString());
|
||||
txt = xrp.masterLabel();
|
||||
txt.replace("%f", QString::number(elmt->diagram()->folioIndex()+1));
|
||||
txt.replace("%F", elmt->diagram() -> border_and_titleblock.folio());
|
||||
txt.replace("%c", QString::number(elmt->diagram() -> convertPosition(elmt -> scenePos()).number()));
|
||||
txt.replace("%l", elmt->diagram() -> convertPosition(elmt -> scenePos()).letter());
|
||||
|
||||
if (add_prefix) {
|
||||
if (elmt->kindInformations()["type"].toString() == "power") txt.prepend(m_properties.prefix("power"));
|
||||
else if (elmt->kindInformations()["type"].toString().contains("delay")) txt.prepend(m_properties.prefix("delay"));
|
||||
|
||||
Reference in New Issue
Block a user