Added some more icons.
This commit is contained in:
@@ -33,7 +33,11 @@
|
||||
|
||||
|
||||
|
||||
BCDataModel::BCDataModel(QObject *parent) : QAbstractListModel(parent) {}
|
||||
BCDataModel::BCDataModel(QObject *parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BCDataModel::addValue(const BCDataValue& val)
|
||||
{
|
||||
@@ -62,6 +66,28 @@ int BCDataModel::rowCount(const QModelIndex& parent) const
|
||||
return _valueList.size();
|
||||
}
|
||||
|
||||
int BCDataModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
if (parent.isValid()) return 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
QVariant BCDataModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
|
||||
return QVariant();
|
||||
|
||||
switch (section)
|
||||
{
|
||||
case 0:
|
||||
return QString("Bezeichnung");
|
||||
case 1:
|
||||
return QString("Wert");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
QVariant BCDataModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
int row = index.row();
|
||||
@@ -83,7 +109,7 @@ Qt::ItemFlags BCDataModel::flags(const QModelIndex& index) const
|
||||
if (!index.isValid())
|
||||
return Qt::NoItemFlags;
|
||||
|
||||
return QAbstractListModel::flags(index) | Qt::ItemIsEditable;
|
||||
return QAbstractTableModel::flags(index) | Qt::ItemIsEditable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user