summaryrefslogtreecommitdiffhomepage
path: root/options/tie.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-05-09 15:34:38 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-05-09 15:34:38 +0200
commit780aca2622d907320a1cf462390f192fb3ae4b31 (patch)
treec7843a5ebe0620d8f97ae7ba86ba6f5d06ffc167 /options/tie.cpp
parentc1de1499775d47a574bd52d07acbb269845fb75b (diff)
parent051fb2f94f6364b80219a3c671bb953d2e54a140 (diff)
Merge branch 'master' into trackhat-sensor-v2
Diffstat (limited to 'options/tie.cpp')
-rw-r--r--options/tie.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/options/tie.cpp b/options/tie.cpp
index c2976217..adf26b53 100644
--- a/options/tie.cpp
+++ b/options/tie.cpp
@@ -28,8 +28,12 @@ void tie_setting(value<QString>& v, QComboBox* cb)
{
cb->setCurrentText(v);
v = cb->currentText();
- value_::connect(cb, SIGNAL(currentTextChanged(QString)), &v, SLOT(setValue(const QString&)), v.DIRECT_CONNTYPE);
- value_::connect(&v, SIGNAL(valueChanged(const QString&)), cb, SLOT(setCurrentText(const QString&)), v.SAFE_CONNTYPE);
+ auto set_current_text = [cb, &v](const QString& str) {
+ cb->setCurrentText(str);
+ v = cb->currentText();
+ };
+ value_::connect(cb, &QComboBox::currentTextChanged, &v, v.value_changed<QString>(), v.DIRECT_CONNTYPE);
+ value_::connect(&v, v.value_changed<QString>(), cb, set_current_text, v.SAFE_CONNTYPE);
}
void tie_setting(value<QVariant>& v, QComboBox* cb)