diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-22 12:54:47 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 23:01:53 +0200 |
commit | f50ac3549d6a7f1199fa012e4b03f581bc8d305b (patch) | |
tree | 50ff044f1c618119c88544709808f533ed02225e /options/tie.hpp | |
parent | d61eb905ae3fa161d50821d01ee47915713e89c2 (diff) |
core, modules: modernize syntax only
Use more C++17 features where this helps any.
Diffstat (limited to 'options/tie.hpp')
-rw-r--r-- | options/tie.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/options/tie.hpp b/options/tie.hpp index ca5eae5e..ff82142e 100644 --- a/options/tie.hpp +++ b/options/tie.hpp @@ -40,7 +40,7 @@ std::enable_if_t<std::is_enum_v<t>> tie_setting(value<t>& v, QComboBox* cb) base_value::connect(cb, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), &v, [&v, cb](int idx) { - run_in_thread_sync(cb, [&]() { + run_in_thread_sync(cb, [&] { v = static_cast<t>(cb->itemData(idx).toInt()); }); }, @@ -48,7 +48,7 @@ std::enable_if_t<std::is_enum_v<t>> tie_setting(value<t>& v, QComboBox* cb) base_value::connect(&v, base_value::value_changed<int>(), cb, [cb](int x) { - run_in_thread_sync(cb, [=]() { cb->setCurrentIndex(cb->findData(x)); }); + run_in_thread_sync(cb, [=] { cb->setCurrentIndex(cb->findData(x)); }); }, v.DIRECT_CONNTYPE); } @@ -61,13 +61,13 @@ void tie_setting(value<t>& v, QComboBox* cb, From&& fn_to_index, To&& fn_to_valu base_value::connect(cb, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), &v, [&v, cb, fn_to_value](int idx) { - run_in_thread_sync(cb, [&]() { + run_in_thread_sync(cb, [&] { v = fn_to_value(idx, cb->currentData()); }); }, v.DIRECT_CONNTYPE); base_value::connect(&v, base_value::value_changed<t>(), cb, [&v, cb, fn_to_index](cv_qualified<t>& v) { - run_in_thread_sync(cb, [&]() { + run_in_thread_sync(cb, [&] { cb->setCurrentIndex(fn_to_index(v)); }); }); |