diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-10 14:08:22 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-10 14:08:22 +0100 |
commit | 2508a1865bf393335b1bf674a8e1e7995a313b53 (patch) | |
tree | 83e5d62ea010a32616f984d987d12834ebde2bd3 /options | |
parent | e6412ba2e9dc6c56664dbcf81ef299499434891a (diff) |
options: rename template
Diffstat (limited to 'options')
-rw-r--r-- | options/base-value.hpp | 2 | ||||
-rw-r--r-- | options/tie.cpp | 8 | ||||
-rw-r--r-- | options/tie.hpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/options/base-value.hpp b/options/base-value.hpp index f000edb1..aabced2a 100644 --- a/options/base-value.hpp +++ b/options/base-value.hpp @@ -38,7 +38,7 @@ public: // MSVC has ODR problems in 15.4 // no C++17 "constexpr inline" for data declarations in MSVC template<typename t> - constexpr static auto signal_fun() + constexpr static auto value_changed() { return static_cast<signal_sig<t>>(&base_value::valueChanged); } diff --git a/options/tie.cpp b/options/tie.cpp index c0552d71..9e693f5c 100644 --- a/options/tie.cpp +++ b/options/tie.cpp @@ -55,7 +55,7 @@ OTR_OPTIONS_EXPORT void tie_setting(value<QVariant>& v, QComboBox* cb) &v, [cb, &v](int idx) { v = cb->itemData(idx); }, v.DIRECT_CONNTYPE); - base_value::connect(&v, base_value::signal_fun<QVariant>(), + base_value::connect(&v, base_value::value_changed<QVariant>(), cb, [cb, set_idx](const QVariant& var) { run_in_thread_sync(cb, [&]() { @@ -91,13 +91,13 @@ OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le) { le->setText(v); base_value::connect(le, SIGNAL(textChanged(QString)), &v, SLOT(setValue(QString)), v.DIRECT_CONNTYPE); - base_value::connect(&v, base_value::signal_fun<QString>(), le, &QLineEdit::setText, v.SAFE_CONNTYPE); + base_value::connect(&v, base_value::value_changed<QString>(), le, &QLineEdit::setText, v.SAFE_CONNTYPE); } OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb) { lb->setText(v); - base_value::connect(&v, base_value::signal_fun<QString>(), lb, &QLabel::setText, v.SAFE_CONNTYPE); + base_value::connect(&v, base_value::value_changed<QString>(), lb, &QLabel::setText, v.SAFE_CONNTYPE); } OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t) @@ -133,7 +133,7 @@ OTR_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w) v.DIRECT_CONNTYPE); base_value::connect(&v, - base_value::signal_fun<slider_value>(), + base_value::value_changed<slider_value>(), w, [=, &v](double) { run_in_thread_sync(w, [=, &v]() diff --git a/options/tie.hpp b/options/tie.hpp index ad38faf8..8d5fe6c5 100644 --- a/options/tie.hpp +++ b/options/tie.hpp @@ -47,7 +47,7 @@ tie_setting(value<t>& v, QComboBox* cb) }); }, v.DIRECT_CONNTYPE); - base_value::connect(&v, base_value::signal_fun<int>(), + base_value::connect(&v, base_value::value_changed<int>(), cb, [cb](int x) { run_in_thread_sync(cb, [&]() { cb->setCurrentIndex(cb->findData(x)); }); }, @@ -60,7 +60,7 @@ void tie_setting(value<t>& v, QLabel* lb, F&& fun) auto closure = [=](cv_qualified<t> x) { lb->setText(fun(x)); }; closure(v()); - base_value::connect(&v, base_value::signal_fun<t>(), + base_value::connect(&v, base_value::value_changed<t>(), lb, closure, v.SAFE_CONNTYPE); } @@ -73,7 +73,7 @@ void tie_setting(value<t>& v, QObject* obj, F&& fun) fun(v()); - base_value::connect(&v, base_value::signal_fun<t>(), + base_value::connect(&v, base_value::value_changed<t>(), obj, fun, v.DIRECT_CONNTYPE); } |