The catalogue now loads the list of databases en there is a table model that can show this data.

This commit is contained in:
eelke 2017-02-12 14:03:42 +01:00
parent a9430bca1a
commit 20af12535e
22 changed files with 504 additions and 118 deletions

39
src/DatabasesTableModel.h Normal file
View file

@ -0,0 +1,39 @@
#ifndef DATABASESTABLEMODEL_H
#define DATABASESTABLEMODEL_H
#include <QAbstractTableModel>
class PgDatabaseContainer;
/** Class for displaying the list of databases of a server in a QTableView
*
*/
class DatabasesTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum e_Columns : int { NameCol, DbaCol, EncodingCol, CollateCol,
CTypeCol, IsTemplateCol, AllowConnCol, ConnLimitCol,
TablespaceCol, AclCol };
explicit DatabasesTableModel(QObject *parent = 0);
// Header:
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
// Basic functionality:
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:
PgDatabaseContainer *m_databases;
};
#endif // DATABASESTABLEMODEL_H