mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50: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:
@@ -122,6 +122,7 @@ void SlaveElement::unlinkElement(Element *elmt)
|
||||
* and add a qgraphicstextitem for show the position of the master
|
||||
*/
|
||||
void SlaveElement::updateLabel() {
|
||||
|
||||
QString label("_");
|
||||
QString Xreflabel;
|
||||
bool no_editable = false;
|
||||
@@ -131,19 +132,12 @@ void SlaveElement::updateLabel() {
|
||||
no_editable = true;
|
||||
Element *elmt = linkedElements().first();
|
||||
label = elmt -> elementInformations()["label"].toString();
|
||||
XRefProperties m_properties = elmt->diagram()->defaultXRefProperties(elmt->kindInformations()["type"].toString());
|
||||
Xreflabel = "(";
|
||||
XRefProperties::ViewMode vw = m_properties.viewMode();
|
||||
if (vw == XRefProperties::Index)
|
||||
{
|
||||
Xreflabel += QString::number(elmt->diagram()->folioIndex()+1);
|
||||
}
|
||||
else if (vw == XRefProperties::FolioLabel){
|
||||
Xreflabel += elmt->diagram()->border_and_titleblock.folio();
|
||||
}
|
||||
Xreflabel += "-";
|
||||
Xreflabel += elmt->diagram() -> convertPosition(elmt -> scenePos()).toString();
|
||||
Xreflabel += ")";
|
||||
XRefProperties xrp = elmt->diagram()->defaultXRefProperties(elmt->kindInformations()["type"].toString());
|
||||
Xreflabel = xrp.slaveLabel();
|
||||
Xreflabel.replace("%f", QString::number(elmt->diagram()->folioIndex()+1));
|
||||
Xreflabel.replace("%F", elmt->diagram() -> border_and_titleblock.folio());
|
||||
Xreflabel.replace("%c", QString::number(elmt->diagram() -> convertPosition(elmt -> scenePos()).number()));
|
||||
Xreflabel.replace("%l", elmt->diagram() -> convertPosition(elmt -> scenePos()).letter());
|
||||
}
|
||||
|
||||
// set the new label
|
||||
|
||||
Reference in New Issue
Block a user