summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/options.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-01-05 12:54:24 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-01-05 12:54:24 +0100
commit0a90675abdba52ac175f0ff4d841f4f3fcc5a6d4 (patch)
treef54f0d25d6f4449e37eabb878dee1725e01e6e9e /facetracknoir/options.h
parente509f882253e0bbb597efaa749af40760c89437c (diff)
be bit more careful with signals firing
Diffstat (limited to 'facetracknoir/options.h')
-rw-r--r--facetracknoir/options.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/facetracknoir/options.h b/facetracknoir/options.h
index 9663a5e8..7c5e57ef 100644
--- a/facetracknoir/options.h
+++ b/facetracknoir/options.h
@@ -253,65 +253,65 @@ namespace options {
template<>
inline void tie_setting(value<int>& v, QComboBox* cb)
{
+ cb->setCurrentIndex(v);
base_value::connect(cb, SIGNAL(currentIndexChanged(int)), &v, SLOT(setValue(int)), v.CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(int)), cb, SLOT(setCurrentIndex(int)), v.CONNTYPE);
- cb->setCurrentIndex(v);
}
template<>
inline void tie_setting(value<QString>& v, QComboBox* cb)
{
+ cb->setCurrentText(v);
+ v = cb->currentText();
base_value::connect(cb, SIGNAL(currentTextChanged(QString)), &v, SLOT(setValue(QString)), v.CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(QString)), cb, SLOT(setCurrentText(QString)), v.CONNTYPE);
- cb->setCurrentText(v);
- v = cb->currentText();
}
template<>
inline void tie_setting(value<bool>& v, QCheckBox* cb)
{
+ cb->setChecked(v);
base_value::connect(cb, SIGNAL(toggled(bool)), &v, SLOT(setValue(bool)), v.CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(bool)), cb, SLOT(setChecked(bool)), v.CONNTYPE);
- cb->setChecked(v);
}
template<>
inline void tie_setting(value<double>& v, QDoubleSpinBox* dsb)
{
+ dsb->setValue(v);
base_value::connect(dsb, SIGNAL(valueChanged(double)), &v, SLOT(setValue(double)), v.CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(double)), dsb, SLOT(setValue(double)), v.CONNTYPE);
- dsb->setValue(v);
}
template<>
inline void tie_setting(value<int>& v, QSpinBox* sb)
{
+ sb->setValue(v);
base_value::connect(sb, SIGNAL(valueChanged(int)), &v, SLOT(setValue(int)), v.CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(int)), sb, SLOT(setValue(int)), v.CONNTYPE);
- sb->setValue(v);
}
template<>
inline void tie_setting(value<int>& v, QSlider* sl)
{
+ sl->setValue(v);
base_value::connect(sl, SIGNAL(valueChanged(int)), &v, SLOT(setValue(int)), v.CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(int)), sl, SLOT(setValue(int)), v.CONNTYPE);
- sl->setValue(v);
}
template<>
inline void tie_setting(value<QString>& v, QLineEdit* le)
{
+ le->setText(v);
base_value::connect(le, SIGNAL(textChanged(QString)), &v, SLOT(setValue(QString)), v.CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(QString)),le, SLOT(setText(QString)), v.CONNTYPE);
- le->setText(v);
}
template<>
inline void tie_setting(value<QString>& v, QLabel* lb)
{
- base_value::connect(&v, SIGNAL(valueChanged(QString)), lb, SLOT(setText(QString)), v.CONNTYPE);
lb->setText(v);
+ base_value::connect(&v, SIGNAL(valueChanged(QString)), lb, SLOT(setText(QString)), v.CONNTYPE);
}
inline pbundle bundle(const QString& group) {