diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-07-01 18:07:03 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-07-01 18:07:03 +0200 |
commit | a67e8630caf20e7f48151024e9e68dd9271d75c7 (patch) | |
tree | e7418eabdfb4abd6ca88c0ba6a427ca5a40e7c32 /tracker-pt/ftnoir_tracker_pt_dialog.cpp | |
parent | 74dff816c07737b7e697e5d63222e59a9fefe23e (diff) |
options/value: add `QObject::connect` wrapper
This is useful not just to save on complexity in call sites, but also
because I plan on using the Verdigris library to remove needless
`valueChanged()` and `setValue()` overloads from each `value<t>`
instance.
Also fix a bug in `options/tie.hpp` where `QComboBox::setCurrentIndex`
was erroneously called as `Qt::DirectConnection`.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt_dialog.cpp')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt_dialog.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp index 160eb831..988239e2 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp +++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp @@ -120,18 +120,22 @@ TrackerDialog_PT::TrackerDialog_PT(const QString& module_name) : tie_setting(s.enable_point_filter, ui.enable_point_filter); tie_setting(s.point_filter_coefficient, ui.point_filter_slider); tie_setting(s.point_filter_limit, ui.point_filter_limit_slider); - connect(&s.point_filter_coefficient, value_::value_changed<slider_value>(), - ui.point_filter_label, [this] { ui.point_filter_label->setValue(*s.point_filter_coefficient); } ); - connect(&s.point_filter_limit, value_::value_changed<slider_value>(), ui.point_filter_limit_label, - [this] { ui.point_filter_limit_label->setValue(*s.point_filter_limit); }, Qt::QueuedConnection); + s.point_filter_coefficient.connect_to(ui.point_filter_label, [this](double x) { + ui.point_filter_label->setValue(x); + }); + + s.point_filter_limit.connect_to(ui.point_filter_limit_label, [this] { + ui.point_filter_limit_label->setValue(*s.point_filter_limit); + }); ui.point_filter_label->setValue(*s.point_filter_coefficient); ui.point_filter_limit_label->setValue(*s.point_filter_limit); tie_setting(s.point_filter_deadzone, ui.point_filter_deadzone_slider); ui.point_filter_deadzone_label->setValue(*s.point_filter_deadzone); - connect(&s.point_filter_deadzone, value_::value_changed<slider_value>(), ui.point_filter_deadzone_label, - [this] { ui.point_filter_deadzone_label->setValue(*s.point_filter_deadzone); }, Qt::QueuedConnection); + s.point_filter_deadzone.connect_to(ui.point_filter_deadzone_label, [this](double x) { + ui.point_filter_deadzone_label->setValue(x); + }); } QString TrackerDialog_PT::threshold_display_text(int threshold_value) |