change labels when toggling between scale and absolute value.

This commit is contained in:
suter_a 2018-07-04 17:03:10 +02:00
parent 86e1544c0e
commit 0882d2c854
2 changed files with 19 additions and 1 deletions

View File

@ -81,9 +81,26 @@ PModSelect::PModSelect(QWidget *parent) :
setLayout(main); setLayout(main);
connect(fAbsVal, SIGNAL(stateChanged(int)), this, SLOT(absoluteValueStateChanged(int)));
connect(fScaleAutomatic, SIGNAL(pressed()), this, SLOT(scaleAuto())); connect(fScaleAutomatic, SIGNAL(pressed()), this, SLOT(scaleAuto()));
connect(fScaleByFactor, SIGNAL(pressed()), this, SLOT(getFactor())); connect(fScaleByFactor, SIGNAL(pressed()), this, SLOT(getFactor()));
connect(fCancel, SIGNAL(pressed()), this, SLOT(reject())); connect(fCancel, SIGNAL(pressed()), this, SLOT(reject()));
}
//-------------------------------------------------------------------------
/**
* @brief PModSelect::absoluteValueStateChanged
* @param ival
*/
void PModSelect::absoluteValueStateChanged(int ival)
{
if (ival == Qt::Unchecked) {
fFactorLabel->setText("Factor");
fScaleByFactor->setText("Scale by &Factor");
} else if (ival == Qt::Checked) {
fFactorLabel->setText("Value");
fScaleByFactor->setText("Set Abs. Value");
}
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -60,6 +60,7 @@ class PModSelect : public QDialog
void scale(bool automatic, double factor, bool absVal); void scale(bool automatic, double factor, bool absVal);
private slots: private slots:
void absoluteValueStateChanged(int);
void scaleAuto(); void scaleAuto();
void getFactor(); void getFactor();