Graphic updates.

This commit is contained in:
2026-01-09 00:45:26 +01:00
parent d6da7aac9a
commit 95765226e9
9 changed files with 98 additions and 896 deletions

View File

@@ -45,8 +45,6 @@ BCValueModel::BCValueModel(QObject *parent)
}
/**
* @brief Gibt die interne Werteliste als const ref zurück
* @return Die WerteListe
@@ -164,34 +162,22 @@ QVariant BCValueModel::data(const QModelIndex& index, int role) const
return QVariant();
/*
Das Model Gibt hier, unabhängig von der DataRole, immer das
* gesamte BCValue Object zurück. Die Umsetzung von Status- und Typeinfromationen in GUI-Elemente
* findet nicht hier, sondern im BCDelagate statt.
// falsch! wie geben hier doch ordentlich die einzelwerte zurück
// Bonus: Rechtsbündig für Zahlen
if (role == Qt::TextAlignmentRole && (index.column() == 0 || index.column() == 2)) {
return Qt::AlignRight | Qt::AlignVCenter;
}
//return QVariant::fromValue( entry );
return QVariant();
*/
}
Qt::ItemFlags BCValueModel::flags(const QModelIndex& index) const
{
Qt::ItemFlags flag = Qt::NoItemFlags|Qt::ItemNeverHasChildren;
// die label spalte lässt sich nicht editieren
if (!index.isValid() || index.column() == 0 )
return Qt::NoItemFlags;
return QAbstractTableModel::flags(index) | Qt::ItemIsEditable;
return flag;
int row = index.row();
if( row>-1 && row<_valueList.size() )
{
const BCValue& bcValue = *_valueList[row].get();
flag = bcValue.isReadOnly() ? flag : flag|Qt::ItemIsEditable|Qt::ItemIsEnabled;
}
return flag;
}