From 562785b09f4641dd71eb36d36bd92c945e0bd7cf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 18 Oct 2016 17:58:37 +0200 Subject: options/tie: output slider_value after truncation error --- options/tie.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'options') diff --git a/options/tie.hpp b/options/tie.hpp index a47dbd3d..accd958e 100644 --- a/options/tie.hpp +++ b/options/tie.hpp @@ -154,12 +154,18 @@ inline void tie_setting(value& v, QSlider* w) base_value::connect(w, &QSlider::valueChanged, &v, - [=, &v](int pos) { v = v->update_from_slider(pos, q_min, q_max); }, + [=, &v](int pos) { + v = v->update_from_slider(pos, q_min, q_max); + w->setValue(v->to_slider_pos(q_min, q_max)); + }, v.DIRECT_CONNTYPE); base_value::connect(&v, static_cast(&base_value::valueChanged), w, - [=, &v](double) { w->setValue(v->to_slider_pos(q_min, q_max)); }, + [=, &v](double) { + w->setValue(v->to_slider_pos(q_min, q_max)); + v = v->update_from_slider(w->value(), q_min, q_max); + }, v.SAFE_CONNTYPE); } -- cgit v1.2.3