diff options
Diffstat (limited to 'facetracknoir/options.hpp')
-rw-r--r-- | facetracknoir/options.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/facetracknoir/options.hpp b/facetracknoir/options.hpp index c9a982bc..900f06c0 100644 --- a/facetracknoir/options.hpp +++ b/facetracknoir/options.hpp @@ -183,7 +183,7 @@ namespace options { QString self_name; pbundle b; public: - value(const pbundle& b, const QString& name, T def) : + value(pbundle& b, const QString& name, T def) : self_name(name), b(b) { @@ -220,6 +220,14 @@ namespace options { } template<> + inline void tie_setting(value<QString>& v, QComboBox* cb) + { + base_value::connect(cb, SIGNAL(currentTextChanged(QString)), &v, SLOT(setValue(int))); + base_value::connect(&v, SIGNAL(valueChanged(QString)), cb, SLOT(setCurrentText(QString))); + cb->setCurrentText(v); + } + + template<> inline void tie_setting(value<bool>& v, QCheckBox* cb) { base_value::connect(cb, SIGNAL(toggled(bool)), &v, SLOT(setValue(bool))); |