diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-06-16 10:06:01 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-06-16 10:06:01 +0200 |
commit | 45d02b4b47488dc86aa30d641eedb9c18241858a (patch) | |
tree | 0795497d426a634b374da5d639d342b7a54b196d /opentrack | |
parent | fab2afe75c7ab809d810ab6a7b263801a0dc1f1a (diff) |
options: add support for QRadioButton
Diffstat (limited to 'opentrack')
-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 a8880cad..3d2f0f9b 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); + } } |