2016-12-26 16:06:55 +01:00
|
|
|
|
#ifndef QUERYRESULTMODEL_H
|
|
|
|
|
|
#define QUERYRESULTMODEL_H
|
|
|
|
|
|
|
2017-12-09 19:47:33 +01:00
|
|
|
|
//#include <QAbstractTableModel>
|
|
|
|
|
|
#include "BaseTableModel.h"
|
2017-08-26 11:45:50 +02:00
|
|
|
|
#include "Pgsql_Connection.h"
|
2016-12-26 16:06:55 +01:00
|
|
|
|
|
2017-12-09 19:47:33 +01:00
|
|
|
|
class QueryResultModel : public BaseTableModel
|
2016-12-26 16:06:55 +01:00
|
|
|
|
{
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
2017-12-09 19:47:33 +01:00
|
|
|
|
protected:
|
|
|
|
|
|
virtual Oid getType(int column) const override;
|
|
|
|
|
|
virtual QVariant getData(const QModelIndex &index) const override;
|
2016-12-26 16:06:55 +01:00
|
|
|
|
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
|