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:59 +0200 |
commit | deb7a542d465e69462e0ca500d21db9d97e14aea (patch) | |
tree | 2d599236069612d23a40518024b9b8dca09c7011 /opentrack/options.hpp | |
parent | 4c5c3904a55a748f3453f5b067e2d6d0f0a11848 (diff) |
options: add support for QRadioButton
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); + } } |