diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-20 05:27:39 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-20 05:27:39 +0200 |
commit | de29cf1031b5898541c0888b5ee6f0bdbbed43d7 (patch) | |
tree | 45c9331039d795007d0081e633e8adcef3cc18f2 /options | |
parent | 2c4b2962d073e16b083347bcd43ffec57ba43ff0 (diff) |
options/tie: prevent feedback loop with enums
Diffstat (limited to 'options')
-rw-r--r-- | options/tie.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/options/tie.hpp b/options/tie.hpp index b6bf32e9..ad38faf8 100644 --- a/options/tie.hpp +++ b/options/tie.hpp @@ -47,9 +47,11 @@ tie_setting(value<t>& v, QComboBox* cb) }); }, v.DIRECT_CONNTYPE); - base_value::connect(&v, static_cast<void (base_value::*)(int) const>(&base_value::valueChanged), - cb, [cb](int x) { cb->setCurrentIndex(cb->findData(x)); }, - v.SAFE_CONNTYPE); + base_value::connect(&v, base_value::signal_fun<int>(), + cb, [cb](int x) { + run_in_thread_sync(cb, [&]() { cb->setCurrentIndex(cb->findData(x)); }); + }, + v.DIRECT_CONNTYPE); } template<typename t, typename F> |