From 1eb2ed6e95332bc6568d796226986e78a02d4785 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Mar 2023 22:44:23 +0100 Subject: options/tie: fix combobox with single element on reload This was breaking the camera list with only one camera present. --- options/tie.cpp | 8 ++++++-- 1 file 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& 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(), v.DIRECT_CONNTYPE); + value_::connect(&v, v.value_changed(), cb, set_current_text, v.SAFE_CONNTYPE); } void tie_setting(value& v, QComboBox* cb) -- cgit v1.2.3