1 #include "stringlistmodel.h"
3 int StringListModel::rowCount(const QModelIndex &parent) const
5 return stringList.count();
8 QVariant StringListModel::data(const QModelIndex &index, int role) const
13 if (index.row() < 0 || index.row() >= stringList.size())
16 if (role == Qt::DisplayRole)
17 return stringList.at(index.row());
21 QVariant StringListModel::headerData(int section, Qt::Orientation orientation, int role) const
23 if (role != Qt::DisplayRole)
26 if (orientation == Qt::Horizontal)
27 return QString("Column %1").arg(section);
29 return QString("Row %1").arg(section);