2016-12-26 16:06:55 +01:00
|
|
|
|
#ifndef QUERYRESULTMODEL_H
|
|
|
|
|
|
#define QUERYRESULTMODEL_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
|
#include "PgsqlConn.h"
|
|
|
|
|
|
|
|
|
|
|
|
class QueryResultModel : public QAbstractTableModel
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
2017-01-08 09:58:34 +01:00
|
|
|
|
QueryResultModel(QObject *parent, std::shared_ptr<Pgsql::Result> r);
|
2016-12-26 16:06:55 +01:00
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|
|
|
|
|
// virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
2017-01-08 09:58:34 +01:00
|
|
|
|
std::shared_ptr<Pgsql::Result> result;
|
2016-12-26 16:06:55 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // QUERYRESULTMODEL_H
|