Reworked value handling.

This commit is contained in:
Christoph Holzheuer
2026-01-19 16:44:52 +01:00
parent 4309d2231e
commit 8639529bbe
12 changed files with 95 additions and 80 deletions

View File

@@ -148,12 +148,12 @@ QVariant BCValueModel::data(const QModelIndex& index, int role) const
const BCValue& value = *(_valueList.at( row ).get());
if( col == 0 )
return value.getLabel();
return value.label();
if( col == 1)
{
if( role == Qt::DisplayRole )
return QString("%1 %2").arg( value.formatValue(), value.getUnitLabel());
return QString("%1 %2").arg( value.formatValue(), value.unitLabel());
return value.formatValue();
}
@@ -183,6 +183,9 @@ bool BCValueModel::setData(const QModelIndex& index, const QVariant& variant, in
{
if (index.isValid() && role == Qt::EditRole)
{
qDebug() << " --- SetData: at: " << index.row() << " --- set: " << variant.toString();
BCValuePtr value = _valueList[index.row()];
// Wir erwarten hier nur den Value-Teil (vom Slider/Editor)