PgAttribute loading + ColummnTableModel
Required enchancement to PgContainer to make multifield key work.
This commit is contained in:
parent
f9caadb59e
commit
e9d72d391d
32 changed files with 698 additions and 99 deletions
44
pglab/ColumnTableModel.h
Normal file
44
pglab/ColumnTableModel.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef COLUMNTABLEMODEL_H
|
||||
#define COLUMNTABLEMODEL_H
|
||||
|
||||
#include "BaseTableModel.h"
|
||||
#include <memory>
|
||||
|
||||
class PgDatabaseCatalog;
|
||||
class PgAttribute;
|
||||
|
||||
class ColumnTableModel: public BaseTableModel {
|
||||
public:
|
||||
enum e_Columns : int {
|
||||
NameCol, ///
|
||||
TypeCol,
|
||||
NullCol,
|
||||
DefaultCol,
|
||||
CollationCol,
|
||||
|
||||
colCount };
|
||||
|
||||
|
||||
using BaseTableModel::BaseTableModel;
|
||||
void setData(std::shared_ptr<const PgDatabaseCatalog> cat, Oid table_oid);
|
||||
|
||||
// Header:
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
|
||||
// Basic functionality:
|
||||
int rowCount(const QModelIndex &parent) const override;
|
||||
int columnCount(const QModelIndex &parent) const override;
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
protected:
|
||||
virtual Oid getType(int column) const override;
|
||||
virtual QVariant getData(const QModelIndex &index) const override;
|
||||
|
||||
using t_Columns = std::vector<PgAttribute>;
|
||||
|
||||
std::shared_ptr<const PgDatabaseCatalog> m_catalog;
|
||||
t_Columns m_columns;
|
||||
|
||||
};
|
||||
|
||||
#endif // COLUMNTABLEMODEL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue