mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-12 06:43:14 +02:00
xref: add option to hide terminal names in cross-references
Add a new boolean property 'showTerminalName' (default: true) to XRefProperties, with full persistence in XML and QSettings. A new checkbox "Afficher les numéros de bornes dans les Xrefs" is added to the XRefPropertiesWidget in the main display group (not in the cross-only group), so it is active in both Cross and Contacts modes. When unchecked, terminal names are hidden in all three rendering paths: - drawContact() (Contacts mode: NO/NC/SW symbols) - fillCrossRef() (Cross mode: NO and NC columns) - setUpCrossBoundingRect() (Cross mode: bounding rect sizing) Backward compatible: existing project files without the attribute default to showTerminalName=true (no visual change). Files changed: sources/properties/xrefproperties.h sources/properties/xrefproperties.cpp sources/ui/xrefpropertieswidget.ui sources/ui/xrefpropertieswidget.cpp sources/qetgraphicsitem/crossrefitem.cpp
This commit is contained in:
@@ -139,6 +139,7 @@ void XRefPropertiesWidget::saveProperties(int index) {
|
||||
else if(ui->m_xrefpos_cb->itemData(ui->m_xrefpos_cb->currentIndex()).toString() == "right") xrp.setXrefPos(Qt::AlignRight);
|
||||
else if(ui->m_xrefpos_cb->itemData(ui->m_xrefpos_cb->currentIndex()).toString() == "alignment") xrp.setXrefPos(Qt::AlignBaseline);
|
||||
xrp.setShowPowerContac(ui->m_show_power_cb->isChecked());
|
||||
xrp.setShowTerminalName(ui->m_show_terminal_name_cb->isChecked());
|
||||
xrp.setPrefix("power", ui->m_power_prefix_le->text());
|
||||
xrp.setPrefix("delay", ui->m_delay_prefix_le->text());
|
||||
xrp.setPrefix("switch", ui->m_switch_prefix_le->text());
|
||||
@@ -190,6 +191,7 @@ void XRefPropertiesWidget::updateDisplay()
|
||||
else if(xrp.getXrefPos() == Qt::AlignBaseline) ui->m_xrefpos_cb->setCurrentIndex(ui->m_xrefpos_cb->findData("alignment"));
|
||||
else if(xrp.getXrefPos() == Qt::AlignBottom) ui->m_xrefpos_cb->setCurrentIndex(ui->m_xrefpos_cb->findData("bottom"));
|
||||
ui->m_show_power_cb->setChecked(xrp.showPowerContact());
|
||||
ui->m_show_terminal_name_cb->setChecked(xrp.showTerminalName());
|
||||
ui->m_power_prefix_le-> setText(xrp.prefix("power"));
|
||||
ui->m_delay_prefix_le-> setText(xrp.prefix("delay"));
|
||||
ui->m_switch_prefix_le->setText(xrp.prefix("switch"));
|
||||
|
||||
@@ -108,6 +108,13 @@
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_show_terminal_name_cb">
|
||||
<property name="text">
|
||||
<string>Afficher les numéros de bornes dans les Xrefs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_display_has_contacts_rb">
|
||||
<property name="text">
|
||||
@@ -283,6 +290,7 @@
|
||||
<tabstop>m_master_le</tabstop>
|
||||
<tabstop>m_slave_le</tabstop>
|
||||
<tabstop>m_show_power_cb</tabstop>
|
||||
<tabstop>m_show_terminal_name_cb</tabstop>
|
||||
<tabstop>m_power_prefix_le</tabstop>
|
||||
<tabstop>m_delay_prefix_le</tabstop>
|
||||
<tabstop>m_switch_prefix_le</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user