34 lines
875 B
C++
34 lines
875 B
C++
#ifndef RESULTMODEL_H
|
|
#define RESULTMODEL_H
|
|
|
|
#include <QAbstractTableModel>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
using std::vector;
|
|
using std::string;
|
|
|
|
class ResultModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ResultModel(vector<vector<int>> inputData,
|
|
vector<string> header, QObject *parent = nullptr);
|
|
|
|
// Header:
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|
|
|
// Basic functionality:
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
private:
|
|
std::vector<std::vector<int>> inputData;
|
|
std::vector<std::string> headers;
|
|
};
|
|
|
|
#endif // RESULTMODEL_H
|