QtHPConnect/vartablemodel.cpp

28 lines
544 B
C++
Raw Normal View History

2019-02-10 14:43:00 +01:00
#include "vartablemodel.h"
2019-02-10 14:32:15 +01:00
2019-02-10 14:43:00 +01:00
varTableModel::varTableModel(QObject *parent)
:QAbstractTableModel(parent)
2019-02-10 14:32:15 +01:00
{
}
2019-02-10 14:43:00 +01:00
int varTableModel::rowCount(const QModelIndex & /*parent*/) const
{
return 16;
}
int varTableModel::columnCount(const QModelIndex & /*parent*/) const
{
return 1;
}
QVariant varTableModel::data(const QModelIndex &index, int role) const
{
if (role == Qt::DisplayRole)
return QString("Row%1, Column%2")
.arg(index.row() + 1)
.arg(index.column() +1);
return QVariant();
}