16 #ifndef QGSDATABASETABLEMODEL_H
17 #define QGSDATABASETABLEMODEL_H
19 #include <QAbstractItemModel>
20 #include <QSortFilterProxyModel>
24 #include "qgis_core.h"
48 RoleTableName = Qt::UserRole,
78 QModelIndex parent(
const QModelIndex &child )
const override;
79 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
80 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
81 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
82 QModelIndex index(
int row,
int column,
const QModelIndex &parent )
const override;
88 void setAllowEmptyTable(
bool allowEmpty );
105 std::unique_ptr< QgsAbstractDatabaseProviderConnection > mConnection;
107 QList<QgsAbstractDatabaseProviderConnection::TableProperty> mTables;
108 bool mAllowEmpty =
false;
The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
A model containing tables from a database connection.
bool allowEmptyTable() const
Returns true if the model allows the empty table ("not set") choice.
@ RoleWkbType
WKB type for primary (first) geometry column in table.
@ RoleEmpty
Entry is an empty entry.
@ RoleCrs
CRS for primary (first) geometry column in table.
@ RoleCustomInfo
Custom info variant map role.
@ RoleTableFlags
Table flags role.
@ RoleComment
Comment role.
@ RoleSchema
Table schema.