diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-19 09:18:57 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-19 09:18:57 +0200 |
commit | 515a3f8e3a3e6091cc58798c36fe51859178143b (patch) | |
tree | 0822a74f4f3a4b65774547211335f114cf3018ca /options/tie.cpp | |
parent | efb9167c2eb8b609a8bc86c119b6a77e999681bf (diff) |
Revert "options/tie: fix deadlocks"
This reverts commit 2ef545b487209fb03bc2506b8e9bfa345d0f392b.
Diffstat (limited to 'options/tie.cpp')
-rw-r--r-- | options/tie.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/options/tie.cpp b/options/tie.cpp index 337843b1..493ff551 100644 --- a/options/tie.cpp +++ b/options/tie.cpp @@ -125,19 +125,30 @@ void tie_setting(value<slider_value>& v, QSlider* w) value_::connect(w, &QSlider::valueChanged, &v, [=, &v](int pos) { - int q_min = w->minimum(); - int q_max = w->maximum(); - v = v->update_from_slider(pos, q_min, q_max); + run_in_thread_sync(w, [&]() + { + const int q_min = w->minimum(); + const int q_max = w->maximum(); + v = v().update_from_slider(pos, q_min, q_max); + w->setValue(v().to_slider_pos(q_min, q_max)); + }); }, v.DIRECT_CONNTYPE); - value_::connect(&v, value_::value_changed<slider_value>(), w, [=, &v](double) { - const int q_min = w->minimum(); - const int q_max = w->maximum(); - const int pos = v->to_slider_pos(q_min, q_max); - w->setValue(pos); + value_::connect(&v, + value_::value_changed<slider_value>(), + w, + [=, &v](double) { + run_in_thread_sync(w, [=, &v]() + { + const int q_min = w->minimum(); + const int q_max = w->maximum(); + const int pos = v->to_slider_pos(q_min, q_max); + v = v->update_from_slider(pos, q_min, q_max); + w->setValue(pos); + }); }, - v.SAFE_CONNTYPE); + v.DIRECT_CONNTYPE); } } // ns options |