57 lines
1.2 KiB
C
57 lines
1.2 KiB
C
|
|
#ifndef PROCTABLEMODEL_H
|
|||
|
|
#define PROCTABLEMODEL_H
|
|||
|
|
|
|||
|
|
#include <QAbstractTableModel>
|
|||
|
|
#include "PgClass.h"
|
|||
|
|
#include "PgProc.h"
|
|||
|
|
#include <memory>
|
|||
|
|
|
|||
|
|
class PgDatabaseCatalog;
|
|||
|
|
class PgProcContainer;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @brief The ProcTableModel class
|
|||
|
|
*
|
|||
|
|
* Hidden values:
|
|||
|
|
*
|
|||
|
|
*/
|
|||
|
|
class ProcTableModel: public QAbstractTableModel {
|
|||
|
|
Q_OBJECT
|
|||
|
|
public:
|
|||
|
|
//using QAbstractTableModel::QAbstractTableModel;
|
|||
|
|
|
|||
|
|
enum e_Columns : int {
|
|||
|
|
NameCol, //
|
|||
|
|
NamespaceCol, // Schema
|
|||
|
|
OwnerCol,
|
|||
|
|
LangCol,
|
|||
|
|
AclCol,
|
|||
|
|
|
|||
|
|
colCount
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
ProcTableModel(QObject *parent = nullptr);
|
|||
|
|
|
|||
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|||
|
|
void setCatalog(std::shared_ptr<const PgDatabaseCatalog> cat);
|
|||
|
|
|
|||
|
|
// Basic functionality:
|
|||
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|||
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|||
|
|
|
|||
|
|
virtual QVariant data(const QModelIndex &index, int role) const override;
|
|||
|
|
|
|||
|
|
PgProc proc(int row) const;
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
std::shared_ptr<const PgDatabaseCatalog> m_catalog;
|
|||
|
|
std::shared_ptr<const PgProcContainer> m_procs;
|
|||
|
|
|
|||
|
|
Oid getType(int column) const;
|
|||
|
|
QVariant getData(const QModelIndex &index) const;
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif // PROCTABLEMODEL_H
|