Added CollationModel + factory for editing and added to EditTableWidget

This commit is contained in:
eelke 2018-12-16 11:35:39 +01:00
parent f0c1035378
commit e75b0f1a71
7 changed files with 107 additions and 19 deletions

View file

@ -1,11 +1,32 @@
#ifndef COLLATIONMODEL_H
#ifndef COLLATIONMODEL_H
#define COLLATIONMODEL_H
#include <QAbstractListModel>
#include <memory>
#include <vector>
class CollationModel
{
class PgCollationContainer;
class CollationModel : public QAbstractListModel {
Q_OBJECT
public:
CollationModel();
enum e_Columns : int {
OidCol,
NameCol, //
colCount
};
explicit CollationModel(QObject *parent = nullptr);
void setCollationList(std::shared_ptr<const PgCollationContainer> collations);
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 PgCollationContainer> m_collations;
};
#endif // COLLATIONMODEL_H
#endif // COLLATIONMODEL_H