fixed big fail

This commit is contained in:
moerp
2021-05-28 17:18:56 +02:00
parent 4d781c3523
commit 308dc809eb
3 changed files with 27 additions and 7 deletions

View File

@ -6,11 +6,11 @@ SQMTableModel::SQMTableModel(QObject *parent)
}
int SQMTableModel::rowCount(const QModelIndex & parent) const {
return binLen;
int SQMTableModel::rowCount(const QModelIndex & /*parent*/) const {
return 2;
}
int SQMTableModel::columnCount(const QModelIndex & parent) const {
int SQMTableModel::columnCount(const QModelIndex & /*parent*/) const {
return 3;
}
@ -26,6 +26,20 @@ QVariant SQMTableModel::data(const QModelIndex &index, int role) const {
return QVariant();
}
QVariant SQMTableModel::headerData(int section, Qt::Orientation orientation, int role) const {
if (role == Qt::DisplayRole && orientation == Qt::Horizontal) {
switch (section) {
case 0:
return QString("BIN");
case 1:
return QString("SQN");
case 2:
return QString("MUL");
}
}
return QVariant();
}
bool SQMTableModel::setData(const QModelIndex &index, const QVariant &value, int role) {
if (role == Qt::EditRole) {