Reorganize files in pglablib

The enitities and containers of the catalog now go into catalog subfolder
Models go into model
This commit is contained in:
eelke 2018-12-16 10:17:59 +01:00
parent 56cbeea183
commit f0c1035378
121 changed files with 226 additions and 183 deletions

View file

@ -0,0 +1,47 @@
#ifndef TYPESELECTIONITEMMODEL_H
#define TYPESELECTIONITEMMODEL_H
#include <QAbstractListModel>
#include <memory>
#include <vector>
class PgTypeContainer;
class TypeSelectionItemModel : public QAbstractListModel {
Q_OBJECT
public:
explicit TypeSelectionItemModel(QObject *parent = 0);
void setTypeList(std::shared_ptr<const PgTypeContainer> types);
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;
private:
std::vector<QString> m_types;
};
class TypeModel : public QAbstractListModel {
Q_OBJECT
public:
enum e_Columns : int {
OidCol,
NameCol, //
colCount
};
explicit TypeModel(QObject *parent = 0);
void setTypeList(std::shared_ptr<const PgTypeContainer> types);
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;
private:
std::shared_ptr<const PgTypeContainer> m_types;
};
#endif // TYPESELECTIONITEMMODEL_H