diff options
Diffstat (limited to 'opentrack/options.hpp')
-rw-r--r-- | opentrack/options.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/opentrack/options.hpp b/opentrack/options.hpp index c33c2f53..5511f567 100644 --- a/opentrack/options.hpp +++ b/opentrack/options.hpp @@ -30,6 +30,7 @@ #include <QCoreApplication> #include <QFileInfo> #include <QDir> +#include <QRadioButton> #include <cinttypes> @@ -450,4 +451,12 @@ namespace options { base_value::connect(t, SIGNAL(currentChanged(int)), &v, SLOT(setValue(int)), v.DIRECT_CONNTYPE); base_value::connect(&v, SIGNAL(valueChanged(int)), t, SLOT(setCurrentIndex(int)), v.SAFE_CONNTYPE); } + + template<> + inline void tie_setting(value<bool>& v, QRadioButton* t) + { + t->setChecked(v); + base_value::connect(t, SIGNAL(toggled(bool)), &v, SLOT(setValue(bool)), v.DIRECT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(bool)), t, SLOT(setChecked(bool)), v.SAFE_CONNTYPE); + } } |