diff --git a/QuantiDialog.cpp b/QuantiDialog.cpp index 58bab5a..ecb3a47 100644 --- a/QuantiDialog.cpp +++ b/QuantiDialog.cpp @@ -6,13 +6,20 @@ QuantiDialog::QuantiDialog(QWidget* parent) : QDialog(parent) , Ui::QuantiDialog() { - + setupUi(this); //connect(area_quanti, static_cast(&QSpinBox::valueChanged), this, SLOT(QuantiDialog::updateLabe())); - + //connect(area_quanti, SIGNAL(valueChanged(int)), this, &QuantiDialog::updateLabelValue); - //connect(area_quanti, static_cast(&QDoubleSpinBox::valueChanged), this, &QuantiDialog::updateLabelValue); - - - + + connect(area_quanti, static_cast(&QDoubleSpinBox::valueChanged), this, &QuantiDialog::updateLabelValues); + + +} +/* + Method applied after entering a value in RGB text fields +*/ +void QuantiDialog::updateLabelValues() +{ + nb_color_label->setText(QString::fromStdString(std::to_string(static_cast(pow(area_quanti->value(), 3))))); } diff --git a/QuantiDialog.h b/QuantiDialog.h index 453d5de..30a1030 100644 --- a/QuantiDialog.h +++ b/QuantiDialog.h @@ -9,15 +9,12 @@ class QuantiDialog : public QDialog, public Ui::QuantiDialog { -Q_OBJECT + Q_OBJECT public: explicit QuantiDialog(QWidget* parent = 0); public slots: - void updateLabelValue(double value) { - nb_color_label->setText(QString::fromStdString(std::to_string(value * value))); - } + void updateLabelValues(); }; - #endif \ No newline at end of file diff --git a/QuantiDialog.ui b/QuantiDialog.ui index 0842027..e267484 100644 --- a/QuantiDialog.ui +++ b/QuantiDialog.ui @@ -50,12 +50,15 @@ - + + + 0 + - 1 + 1.000000000000000 - 255 + 255.000000000000000 @@ -111,6 +114,9 @@ Qt::AlignCenter + + 0 +