diff options
-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 1938ba08..7eeda198 100644 --- a/opentrack/options.hpp +++ b/opentrack/options.hpp @@ -26,6 +26,7 @@ #include <QSlider> #include <QLineEdit> #include <QLabel> +#include <QTabWidget> #include <QCoreApplication> #include <cinttypes> @@ -412,4 +413,12 @@ namespace options { lb->setText(v); base_value::connect(&v, SIGNAL(valueChanged(QString)), lb, SLOT(setText(QString)), v.SAFE_CONNTYPE); } + + template<> + inline void tie_setting(value<int>& v, QTabWidget* t) + { + t->setCurrentIndex(v); + 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); + } } |