From d93d2a4f373f79e86e855c43815edf26cc455e3d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 30 Dec 2013 11:29:28 +0100 Subject: support QLineEdit --- facetracknoir/options.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'facetracknoir') 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 #include #include +#include namespace options { template - inline T qcruft_to_t(const QVariant& t); + inline T qcruft_to_t (const QVariant& t); template<> inline int qcruft_to_t(const QVariant& t) @@ -31,6 +32,12 @@ namespace options { return t.toInt(); } + template<> + inline QString qcruft_to_t(const QVariant& t) + { + return t.toString(); + } + template<> inline bool qcruft_to_t(const QVariant& t) { @@ -244,6 +251,14 @@ namespace options { sl->setValue(v); } + template<> + inline void tie_setting(value& 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(group); } -- cgit v1.2.3