summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy/tracker-easy.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-07-01 18:07:03 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-07-01 18:07:03 +0200
commita67e8630caf20e7f48151024e9e68dd9271d75c7 (patch)
treee7418eabdfb4abd6ca88c0ba6a427ca5a40e7c32 /tracker-easy/tracker-easy.cpp
parent74dff816c07737b7e697e5d63222e59a9fefe23e (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-easy/tracker-easy.cpp')
-rw-r--r--tracker-easy/tracker-easy.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tracker-easy/tracker-easy.cpp b/tracker-easy/tracker-easy.cpp
index 7046a918..a4b7ca4c 100644
--- a/tracker-easy/tracker-easy.cpp
+++ b/tracker-easy/tracker-easy.cpp
@@ -59,31 +59,31 @@ namespace EasyTracker
connect(&*iSettings.b, &bundle_::saving, this, &Tracker::CheckCamera, Qt::DirectConnection);
connect(&*iSettings.b, &bundle_::reloading, this, &Tracker::CheckCamera, Qt::DirectConnection);
- connect(&iSettings.fov, value_::value_changed<int>(), this, &Tracker::set_fov, Qt::DirectConnection);
+ iSettings.fov.connect_to(this, &Tracker::set_fov, Qt::DirectConnection);
set_fov(iSettings.fov);
// We could not get this working, nevermind
//connect(&iSettings.cam_fps, value_::value_changed<int>(), this, &Tracker::SetFps, Qt::DirectConnection);
// Make sure deadzones are updated whenever the settings are changed
- connect(&iSettings.DeadzoneRectHalfEdgeSize, value_::value_changed<int>(), this, &Tracker::UpdateSettings, Qt::DirectConnection);
+ iSettings.DeadzoneRectHalfEdgeSize.connect_to(this, &Tracker::UpdateSettings, Qt::DirectConnection);
// Update point extractor whenever some of the settings it needs are changed
- connect(&iSettings.iMinBlobSize, value_::value_changed<int>(), this, &Tracker::UpdateSettings, Qt::DirectConnection);
- connect(&iSettings.iMaxBlobSize, value_::value_changed<int>(), this, &Tracker::UpdateSettings, Qt::DirectConnection);
+ iSettings.iMinBlobSize.connect_to(this, &Tracker::UpdateSettings, Qt::DirectConnection);
+ iSettings.iMaxBlobSize.connect_to(this, &Tracker::UpdateSettings, Qt::DirectConnection);
// Make sure solver is updated whenever the settings are changed
- connect(&iSettings.PnpSolver, value_::value_changed<int>(), this, &Tracker::UpdateSettings, Qt::DirectConnection);
+ iSettings.PnpSolver.connect_to(this, &Tracker::UpdateSettings, Qt::DirectConnection);
// Debug
- connect(&iSettings.debug, value_::value_changed<bool>(), this, &Tracker::UpdateSettings, Qt::DirectConnection);
+ iSettings.debug.connect_to(this, &Tracker::UpdateSettings, Qt::DirectConnection);
// Make sure model is updated whenever it is changed
- connect(&iSettings.iCustomModelThree, value_::value_changed<bool>(), this, &Tracker::UpdateModel, Qt::DirectConnection);
- connect(&iSettings.iCustomModelFour, value_::value_changed<bool>(), this, &Tracker::UpdateModel, Qt::DirectConnection);
- connect(&iSettings.iCustomModelFive, value_::value_changed<bool>(), this, &Tracker::UpdateModel, Qt::DirectConnection);
+ iSettings.iCustomModelThree.connect_to(this, &Tracker::UpdateModel, Qt::DirectConnection);
+ iSettings.iCustomModelFour .connect_to(this, &Tracker::UpdateModel, Qt::DirectConnection);
+ iSettings.iCustomModelFive .connect_to(this, &Tracker::UpdateModel, Qt::DirectConnection);
// Update model logic
- #define UM(v) connect(&iSettings.v, value_::value_changed<int>(), this, &Tracker::UpdateModel, Qt::DirectConnection)
+ #define UM(v) iSettings.v.connect_to(this, &Tracker::UpdateModel, Qt::DirectConnection)
UM(iVertexTopX); UM(iVertexTopY); UM(iVertexTopZ);
UM(iVertexTopRightX); UM(iVertexTopRightY); UM(iVertexTopRightZ);
UM(iVertexTopLeftX); UM(iVertexTopLeftY); UM(iVertexTopLeftZ);