From 39ea3871c1b3f594df846bc0b9a627c9880ecea4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 5 Oct 2018 15:46:01 +0200 Subject: use attributes only at declaration, not definition --- options/tie.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'options/tie.cpp') diff --git a/options/tie.cpp b/options/tie.cpp index 9de3df4c..1f2d7dae 100644 --- a/options/tie.cpp +++ b/options/tie.cpp @@ -11,7 +11,7 @@ namespace options { -OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) +void tie_setting(value& v, QComboBox* cb) { cb->setCurrentIndex(v); v = cb->currentIndex(); @@ -19,7 +19,7 @@ OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) value_::connect(&v, SIGNAL(valueChanged(int)), cb, SLOT(setCurrentIndex(int)), v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) +void tie_setting(value& v, QComboBox* cb) { cb->setCurrentText(v); v = cb->currentText(); @@ -27,7 +27,7 @@ OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) value_::connect(&v, SIGNAL(valueChanged(const QString&)), cb, SLOT(setCurrentText(const QString&)), v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) +void tie_setting(value& v, QComboBox* cb) { auto set_idx = [cb](const QVariant& var) { const int sz = cb->count(); @@ -50,7 +50,7 @@ OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) if (idx != -1) v = cb->itemData(idx); else - v = QVariant(QVariant::Invalid); + v = {}; value_::connect(cb, static_cast(&QComboBox::currentIndexChanged), &v, [cb, &v](int idx) { @@ -67,48 +67,48 @@ OTR_OPTIONS_EXPORT void tie_setting(value& v, QComboBox* cb) // XXX TODO need variant with setEnabled based on lambda retval -- sh 20170524 -OTR_OPTIONS_EXPORT void tie_setting(value& v, QCheckBox* cb) +void tie_setting(value& v, QCheckBox* cb) { cb->setChecked(v); value_::connect(cb, SIGNAL(toggled(bool)), &v, SLOT(setValue(bool)), v.DIRECT_CONNTYPE); value_::connect(&v, SIGNAL(valueChanged(bool)), cb, SLOT(setChecked(bool)), v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QDoubleSpinBox* dsb) +void tie_setting(value& v, QDoubleSpinBox* dsb) { dsb->setValue(v); value_::connect(dsb, SIGNAL(valueChanged(double)), &v, SLOT(setValue(double)), v.DIRECT_CONNTYPE); value_::connect(&v, SIGNAL(valueChanged(double)), dsb, SLOT(setValue(double)), v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QSpinBox* sb) +void tie_setting(value& v, QSpinBox* sb) { sb->setValue(v); value_::connect(sb, SIGNAL(valueChanged(int)), &v, SLOT(setValue(int)), v.DIRECT_CONNTYPE); value_::connect(&v, SIGNAL(valueChanged(int)), sb, SLOT(setValue(int)), v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QLineEdit* le) +void tie_setting(value& v, QLineEdit* le) { le->setText(v); value_::connect(le, SIGNAL(textChanged(QString)), &v, SLOT(setValue(QString)), v.DIRECT_CONNTYPE); value_::connect(&v, value_::value_changed(), le, &QLineEdit::setText, v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QLabel* lb) +void tie_setting(value& v, QLabel* lb) { lb->setText(v); value_::connect(&v, value_::value_changed(), lb, &QLabel::setText, v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QTabWidget* t) +void tie_setting(value& v, QTabWidget* t) { t->setCurrentIndex(v); value_::connect(t, SIGNAL(currentChanged(int)), &v, SLOT(setValue(int)), v.DIRECT_CONNTYPE); value_::connect(&v, SIGNAL(valueChanged(int)), t, SLOT(setCurrentIndex(int)), v.SAFE_CONNTYPE); } -OTR_OPTIONS_EXPORT void tie_setting(value& v, QSlider* w) +void tie_setting(value& v, QSlider* w) { { const int q_min = w->minimum(); -- cgit v1.2.3