40 lines
1,003 B
C
40 lines
1,003 B
C
|
|
#ifndef ROLESTABLEMODEL_H
|
|||
|
|
#define ROLESTABLEMODEL_H
|
|||
|
|
|
|||
|
|
|
|||
|
|
#include <QAbstractTableModel>
|
|||
|
|
|
|||
|
|
class PgAuthIdContainer;
|
|||
|
|
|
|||
|
|
/** Class for displaying the list of roles of a server in a QTableView
|
|||
|
|
*
|
|||
|
|
*/
|
|||
|
|
class RolesTableModel : public QAbstractTableModel {
|
|||
|
|
Q_OBJECT
|
|||
|
|
public:
|
|||
|
|
enum e_Columns : int { NameCol, SuperCol, InheritCol, CreateRoleCol,
|
|||
|
|
CreateDBCol, CanLoginCol, ReplicationCol,
|
|||
|
|
BypassRlsCol, ConnlimitCol, ValidUntilCol };
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
explicit RolesTableModel(QObject *parent);
|
|||
|
|
|
|||
|
|
void setRoleList(const PgAuthIdContainer* roles);
|
|||
|
|
|
|||
|
|
// 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:
|
|||
|
|
const PgAuthIdContainer *m_roles = nullptr;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif // ROLESTABLEMODEL_H
|