Standardisation of auto widgets

This commit is contained in:
elecpower
2021-03-17 09:53:32 +11:00
parent e801f490b3
commit 60ac1550f4
5 changed files with 53 additions and 37 deletions
+6 -6
View File
@@ -123,7 +123,7 @@ class AutoPrecisionComboBox: public QComboBox
if (*m_field != val) {
*m_field = rangecheckDecimals(val);
updateValue();
emit valueChanged();
emit currentDataChanged(value);
}
}
@@ -134,7 +134,7 @@ class AutoPrecisionComboBox: public QComboBox
if (*m_field != value) {
*m_field = rangecheckDecimals(value);
updateValue();
emit valueChanged();
emit currentDataChanged((int)value);
}
}
@@ -160,7 +160,7 @@ class AutoPrecisionComboBox: public QComboBox
}
signals:
void valueChanged();
void currentDataChanged(int index);
protected slots:
void init()
@@ -203,13 +203,13 @@ class AutoPrecisionComboBox: public QComboBox
void onCurrentIndexChanged(int index)
{
if (index < 0)
if (index < 0 || (m_panel && m_panel->lock) || m_lock)
return;
if (m_field && !m_lock) {
if (m_field) {
*m_field = itemData(index).toUInt();
emit currentDataChanged(index);
if (m_panel)
emit m_panel->modified();
emit valueChanged();
}
}