From deb7a542d465e69462e0ca500d21db9d97e14aea Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jun 2015 10:06:01 +0200 Subject: options: add support for QRadioButton --- opentrack/options.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'opentrack') 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 #include #include +#include #include @@ -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& 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); + } } -- cgit v1.2.3