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 /spline | |
| 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 'spline')
| -rw-r--r-- | spline/spline.cpp | 9 | 
1 files changed, 3 insertions, 6 deletions
diff --git a/spline/spline.cpp b/spline/spline.cpp index ecbfc3a0..b8f84df5 100644 --- a/spline/spline.cpp +++ b/spline/spline.cpp @@ -390,12 +390,9 @@ void spline::set_bundle(bundle b, const QString& axis_name, Axis axis)          invalidate_settings_();          S = s; -        conn_points = QObject::connect(&s->points, value_::value_changed<QList<QPointF>>(), -                                       &*ctx, [this] { invalidate_settings(); }, Qt::DirectConnection); -        conn_maxx   = QObject::connect(&s->opts.clamp_x_, value_::value_changed<int>(), -                                       &*ctx, [this](double) { invalidate_settings(); }, Qt::DirectConnection); -        conn_maxy   = QObject::connect(&s->opts.clamp_y_, value_::value_changed<int>(), -                                       &*ctx, [this](double) { invalidate_settings(); }, Qt::DirectConnection); +        conn_points = s->points.connect_to(&*ctx, &spline::invalidate_settings(), Qt::DirectConnection); +        conn_maxx   = s->opts.clamp_x_.connect_to(&*ctx, &spline::invalidate_settings, Qt::DirectConnection); +        conn_maxy   = s->opts.clamp_y_.connect_to(&*ctx, &spline::invalidate_settings(), Qt::DirectConnection);      }      emit S->recomputed();  | 
