From 6eea58b542d59e08b4630535b0dbe78d37e6c705 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 15 Aug 2016 15:32:29 +0200 Subject: compat/options: cast to the right type for bigger than word things --- compat/options.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compat/options.hpp b/compat/options.hpp index 432ed52a..454cc99a 100644 --- a/compat/options.hpp +++ b/compat/options.hpp @@ -160,6 +160,13 @@ namespace options { #define OPENTRACK_DEFINE_SLOT(t) void setValue(t datum) { store(datum); } #define OPENTRACK_DEFINE_SIGNAL(t) void valueChanged(t) + namespace detail { + template struct value_type_traits { using type = t;}; + template<> struct value_type_traits { using type = const QString&; }; + template<> struct value_type_traits { using type = const slider_value&; }; + template using value_type_t = typename value_type_traits::type; + } + class OPENTRACK_COMPAT_EXPORT base_value : public QObject { Q_OBJECT @@ -181,7 +188,7 @@ namespace options { void store(const t& datum) { b->store_kv(self_name, QVariant::fromValue(datum)); - emit valueChanged(static_cast(datum)); + emit valueChanged(static_cast>(datum)); } void store(float datum) { -- cgit v1.2.3