WIP: Added page showing list of functions.
Only list is shown, still working on details.
This commit is contained in:
parent
7db859737a
commit
840af1e0a9
19 changed files with 635 additions and 92 deletions
56
pglab/ProcTableModel.h
Normal file
56
pglab/ProcTableModel.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue