From 61884594ceff59279abe5530c8c1af1870dc8fbb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Oct 2022 18:34:03 +0200 Subject: Revert "options/value: add `QObject::connect` wrapper" This reverts commit a67e8630caf20e7f48151024e9e68dd9271d75c7. --- gui/mapping-dialog.cpp | 8 +++++--- gui/options-dialog.cpp | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'gui') diff --git a/gui/mapping-dialog.cpp b/gui/mapping-dialog.cpp index bdf33a77..cdbf532e 100644 --- a/gui/mapping-dialog.cpp +++ b/gui/mapping-dialog.cpp @@ -117,7 +117,9 @@ void mapping_dialog::load() if (altp) { - axis.opts.altp.connect_to(this, [&](bool f) { qfc.setEnabled(f); }); + connect(&axis.opts.altp, + value_::value_changed(), + this, [&](bool f) { qfc.setEnabled(f); }); qfc.setEnabled(axis.opts.altp); } @@ -162,8 +164,8 @@ void mapping_dialog::load() qfc.set_snap(.5, 1); - axis.opts.clamp_x_.connect_to(&qfc, update_xstep); - axis.opts.clamp_y_.connect_to(&qfc, update_ystep); + connect(&axis.opts.clamp_x_, value_::value_changed(), &qfc, update_xstep); + connect(&axis.opts.clamp_y_, value_::value_changed(), &qfc, update_ystep); // force signal to avoid duplicating the slot's logic qfc.set_config(&conf); diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index ab36d73b..ac4117bc 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -167,8 +167,13 @@ options_dialog::options_dialog(std::unique_ptr& tracker_dialog_, { tmp val = val_; val.label->setText(kopts_to_string(val.opt)); - val.opt.keycode.connect_to(val.label, [=] { val.label->setText(kopts_to_string(val.opt)); }, Qt::DirectConnection); - connect(val.button, &QPushButton::clicked, this, [=] { bind_key(val.opt, val.label); }); + connect(&val.opt.keycode, + static_cast(&value_::valueChanged), + val.label, + [=](const QString&) { val.label->setText(kopts_to_string(val.opt)); }); + { + connect(val.button, &QPushButton::clicked, this, [=] { bind_key(val.opt, val.label); }); + } } auto add_module_tab = [this] (auto& place, auto&& dlg, const QString& label) { -- cgit v1.2.3