Commit 4f0c2f88 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

use shareValue when connecting a widget to a parameter

parent d310e877
......@@ -82,7 +82,7 @@ bool dtkWidgetsParameterBoolCheckBox::connect(dtkCoreParameter *p)
QObject::connect(d->check_box, &QCheckBox::stateChanged, [=] (int state)
{
m_parameter->setValue(state == Qt::Checked);
m_parameter->shareValue(QVariant::fromValue(state == Qt::Checked));
});
return true;
......
......@@ -97,7 +97,7 @@ bool dtkWidgetsParameterBoolPushButton::connect(dtkCoreParameter *p)
} else {
d->running = true;
}
m_parameter->setValue(d->running);
m_parameter->shareValue(QVariant::fromValue(d->running));
});
return true;
......
......@@ -79,7 +79,7 @@ bool dtkWidgetsParameterDoubleSpinBox::connect(dtkCoreParameter *p)
QObject::connect(d->spin_box, QOverload<double>::of(&dtkWidgetsSpinBoxDouble::valueChanged), [=] (double v)
{
m_parameter->setValue(v);
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
......@@ -73,7 +73,8 @@ bool dtkWidgetsParameterFileBrowse::connect(dtkCoreParameter *p)
QObject::connect(d->push_button, &QPushButton::clicked, [=] ()
{
m_parameter->setValue(QFileDialog::getOpenFileName(this, "Open file", m_parameter->dirName(), m_parameter->filters().join(";;")));
QString v = QFileDialog::getOpenFileName(this, "Open file", m_parameter->dirName(), m_parameter->filters().join(";;"));
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
......@@ -73,7 +73,8 @@ bool dtkWidgetsParameterFileSave::connect(dtkCoreParameter *p)
QObject::connect(d->push_button, &QPushButton::clicked, [=] ()
{
m_parameter->setValue(QFileDialog::getSaveFileName(this, "Save file", m_parameter->dirName(), m_parameter->filters().join(";;")));
QString v = QFileDialog::getSaveFileName(this, "Save file", m_parameter->dirName(), m_parameter->filters().join(";;"));
m_parameter->setValue(QVariant::fromValue(v));
});
return true;
......
......@@ -76,7 +76,7 @@ bool dtkWidgetsParameterIntSlider::connect(dtkCoreParameter *p)
QObject::connect(d->slider, QOverload<int>::of(&QSlider::valueChanged), [=] (int v)
{
m_parameter->setValue(v);
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
......@@ -76,7 +76,7 @@ bool dtkWidgetsParameterIntSpinBox::connect(dtkCoreParameter *p)
QObject::connect(d->spin_box, QOverload<int>::of(&QSpinBox::valueChanged), [=] (int v)
{
m_parameter->setValue(v);
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
......@@ -78,7 +78,7 @@ bool dtkWidgetsParameterLongLongSpinBox::connect(dtkCoreParameter *p)
QObject::connect(d->spin_box, QOverload<long long>::of(&dtkWidgetsSpinBoxLong::valueChanged), [=] (long long v)
{
m_parameter->setValue(v);
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
......@@ -78,7 +78,7 @@ bool dtkWidgetsParameterScientificSpinBox::connect(dtkCoreParameter *p)
QObject::connect(d->spin_box, QOverload<double>::of(&dtkWidgetsSpinBoxDouble::valueChanged), [=] (double v)
{
m_parameter->setValue(v);
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
......@@ -71,7 +71,7 @@ bool dtkWidgetsParameterStringLineEdit::connect(dtkCoreParameter *p)
QObject::connect(d->line_edit, &QLineEdit::textChanged, [=] (const QString& v)
{
m_parameter->setValue(v);
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
......@@ -84,7 +84,7 @@ bool dtkWidgetsParameterStringListComboBox::connect(dtkCoreParameter *p)
QObject::connect(d->combo_box, &QComboBox::currentTextChanged, [=] (const QString& v)
{
m_parameter->setValue(v);
m_parameter->shareValue(QVariant::fromValue(v));
});
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment