mirror of
https://gitlab.univ-nantes.fr/E164955Z/ptrans.git
synced 2026-08-29 07:40:28 +08:00
patch ui
This commit is contained in:
+13
-6
@@ -6,13 +6,20 @@ QuantiDialog::QuantiDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, Ui::QuantiDialog()
|
||||
{
|
||||
|
||||
|
||||
setupUi(this);
|
||||
//connect(area_quanti, static_cast<void(QSpinBox::*)(double)>(&QSpinBox::valueChanged), this, SLOT(QuantiDialog::updateLabe()));
|
||||
|
||||
|
||||
//connect(area_quanti, SIGNAL(valueChanged(int)), this, &QuantiDialog::updateLabelValue);
|
||||
//connect(area_quanti, static_cast<void(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &QuantiDialog::updateLabelValue);
|
||||
|
||||
|
||||
|
||||
|
||||
connect(area_quanti, static_cast<void(QDoubleSpinBox::*)(double)>(&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<int>(pow(area_quanti->value(), 3)))));
|
||||
}
|
||||
|
||||
+2
-5
@@ -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
|
||||
+9
-3
@@ -50,12 +50,15 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="area_quanti">
|
||||
<widget class="QDoubleSpinBox" name="area_quanti">
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
<double>255.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -111,6 +114,9 @@
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user