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 /video-ps3eye | |
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 'video-ps3eye')
-rw-r--r-- | video-ps3eye/module.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/video-ps3eye/module.cpp b/video-ps3eye/module.cpp index 02543082..04e7ecbe 100644 --- a/video-ps3eye/module.cpp +++ b/video-ps3eye/module.cpp @@ -266,8 +266,9 @@ dialog::dialog(QWidget* parent) : QWidget(parent) tie_setting(s.gain, ui.gain_slider); ui.exposure_label->setValue((int)*s.exposure); ui.gain_label->setValue((int)*s.gain); - connect(&s.exposure, value_::value_changed<slider_value>(), this, [this](const slider_value&) { t.stop(); t.start(); }); - connect(&s.gain, value_::value_changed<slider_value>(), this, [this](const slider_value&) { t.stop(); t.start(); }); + s.exposure.connect_to(this, [this] { t.stop(); t.start(); }); + s.gain.connect_to(this, [this] { t.stop(); t.start(); }); + connect(ui.exposure_slider, &QSlider::valueChanged, ui.exposure_label, &QSpinBox::setValue); connect(ui.gain_slider, &QSlider::valueChanged, ui.gain_label, &QSpinBox::setValue); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &dialog::do_ok); |