From 0882d2c8544b381a677e14882a28e0c418803e82 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Wed, 4 Jul 2018 17:03:10 +0200 Subject: [PATCH] change labels when toggling between scale and absolute value. --- src/musredit_qt5/musrStep/PMusrStep.cpp | 19 ++++++++++++++++++- src/musredit_qt5/musrStep/PMusrStep.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/musredit_qt5/musrStep/PMusrStep.cpp b/src/musredit_qt5/musrStep/PMusrStep.cpp index 13d6bb9c..57aa87e8 100644 --- a/src/musredit_qt5/musrStep/PMusrStep.cpp +++ b/src/musredit_qt5/musrStep/PMusrStep.cpp @@ -81,9 +81,26 @@ PModSelect::PModSelect(QWidget *parent) : setLayout(main); + connect(fAbsVal, SIGNAL(stateChanged(int)), this, SLOT(absoluteValueStateChanged(int))); connect(fScaleAutomatic, SIGNAL(pressed()), this, SLOT(scaleAuto())); 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"); + } } //------------------------------------------------------------------------- diff --git a/src/musredit_qt5/musrStep/PMusrStep.h b/src/musredit_qt5/musrStep/PMusrStep.h index a66e80da..7df7c5d5 100644 --- a/src/musredit_qt5/musrStep/PMusrStep.h +++ b/src/musredit_qt5/musrStep/PMusrStep.h @@ -60,6 +60,7 @@ class PModSelect : public QDialog void scale(bool automatic, double factor, bool absVal); private slots: + void absoluteValueStateChanged(int); void scaleAuto(); void getFactor();