mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Minor: Enable XRef Offset Spinbox only when Snap to Bottom is selected
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4551 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -34,6 +34,7 @@ XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> prope
|
|||||||
buildUi();
|
buildUi();
|
||||||
connect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool)));
|
connect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool)));
|
||||||
connect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged()));
|
connect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged()));
|
||||||
|
connect(ui->m_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int)));
|
||||||
updateDisplay();
|
updateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ XRefPropertiesWidget::~XRefPropertiesWidget()
|
|||||||
{
|
{
|
||||||
disconnect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool)));
|
disconnect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool)));
|
||||||
disconnect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged()));
|
disconnect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged()));
|
||||||
|
disconnect(ui->m_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int)));
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,9 +151,14 @@ void XRefPropertiesWidget::updateDisplay() {
|
|||||||
int offset = xrp.offset();
|
int offset = xrp.offset();
|
||||||
ui->m_offset_sb->setValue(offset);
|
ui->m_offset_sb->setValue(offset);
|
||||||
|
|
||||||
if (xrp.snapTo() == XRefProperties::Bottom)
|
if (xrp.snapTo() == XRefProperties::Bottom){
|
||||||
ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("bottom"));
|
ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("bottom"));
|
||||||
else ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("label"));
|
ui->m_offset_sb->setEnabled(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("label"));
|
||||||
|
ui->m_offset_sb->setEnabled(false);
|
||||||
|
}
|
||||||
ui->m_show_power_cb->setChecked(xrp.showPowerContact());
|
ui->m_show_power_cb->setChecked(xrp.showPowerContact());
|
||||||
ui->m_power_prefix_le-> setText(xrp.prefix("power"));
|
ui->m_power_prefix_le-> setText(xrp.prefix("power"));
|
||||||
ui->m_delay_prefix_le-> setText(xrp.prefix("delay"));
|
ui->m_delay_prefix_le-> setText(xrp.prefix("delay"));
|
||||||
@@ -173,3 +180,14 @@ void XRefPropertiesWidget::typeChanged() {
|
|||||||
//previous index is now the current index
|
//previous index is now the current index
|
||||||
m_previous_type_index = ui->m_type_cb->currentIndex();
|
m_previous_type_index = ui->m_type_cb->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief XRefPropertiesWidget::enableOffsetSB
|
||||||
|
* Enable Offset SB only if Snap to Footer is selected
|
||||||
|
*/
|
||||||
|
void XRefPropertiesWidget::enableOffsetSB(int i){
|
||||||
|
if (i)
|
||||||
|
ui->m_offset_sb->setEnabled(false);
|
||||||
|
else
|
||||||
|
ui->m_offset_sb->setEnabled(true);
|
||||||
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class XRefPropertiesWidget : public QWidget
|
|||||||
private slots:
|
private slots:
|
||||||
void updateDisplay();
|
void updateDisplay();
|
||||||
void typeChanged();
|
void typeChanged();
|
||||||
|
void enableOffsetSB(int i);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user