summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/options.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'facetracknoir/options.hpp')
-rw-r--r--facetracknoir/options.hpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/facetracknoir/options.hpp b/facetracknoir/options.hpp
index 67c0958d..c9a982bc 100644
--- a/facetracknoir/options.hpp
+++ b/facetracknoir/options.hpp
@@ -20,10 +20,11 @@
#include <QDoubleSpinBox>
#include <QSpinBox>
#include <QSlider>
+#include <QLineEdit>
namespace options {
template<typename T>
- inline T qcruft_to_t(const QVariant& t);
+ inline T qcruft_to_t (const QVariant& t);
template<>
inline int qcruft_to_t<int>(const QVariant& t)
@@ -32,6 +33,12 @@ namespace options {
}
template<>
+ inline QString qcruft_to_t<QString>(const QVariant& t)
+ {
+ return t.toString();
+ }
+
+ template<>
inline bool qcruft_to_t<bool>(const QVariant& t)
{
return t.toBool();
@@ -244,6 +251,14 @@ namespace options {
sl->setValue(v);
}
+ template<>
+ inline void tie_setting(value<QString>& v, QLineEdit* le)
+ {
+ base_value::connect(le, SIGNAL(textChanged(QString)), &v, SLOT(setValue(QString)));
+ base_value::connect(&v, SIGNAL(valueChanged(QString)),le, SLOT(setText(QString)));
+ le->setText(v);
+ }
+
inline pbundle bundle(const QString& group) {
return std::make_shared<impl_bundle>(group);
}