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 /gui/mapping-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 'gui/mapping-dialog.cpp')
-rw-r--r-- | gui/mapping-dialog.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gui/mapping-dialog.cpp b/gui/mapping-dialog.cpp index cdbf532e..bdf33a77 100644 --- a/gui/mapping-dialog.cpp +++ b/gui/mapping-dialog.cpp @@ -117,9 +117,7 @@ void mapping_dialog::load() if (altp) { - connect(&axis.opts.altp, - value_::value_changed<bool>(), - this, [&](bool f) { qfc.setEnabled(f); }); + axis.opts.altp.connect_to(this, [&](bool f) { qfc.setEnabled(f); }); qfc.setEnabled(axis.opts.altp); } @@ -164,8 +162,8 @@ void mapping_dialog::load() qfc.set_snap(.5, 1); - connect(&axis.opts.clamp_x_, value_::value_changed<int>(), &qfc, update_xstep); - connect(&axis.opts.clamp_y_, value_::value_changed<int>(), &qfc, update_ystep); + axis.opts.clamp_x_.connect_to(&qfc, update_xstep); + axis.opts.clamp_y_.connect_to(&qfc, update_ystep); // force signal to avoid duplicating the slot's logic qfc.set_config(&conf); |