| QGIS API Documentation
    3.20.0-Odense (decaadbb31)
    | 
A model containing schemas from a database connection. More...
#include <qgsdatabaseschemamodel.h>

| Public Types | |
| enum | Role { RoleEmpty = Qt::UserRole } | 
| Model roles.  More... | |
| Public Slots | |
| void | refresh () | 
| Refreshes the schema list by querying the underlying connection.  More... | |
| Public Member Functions | |
| QgsDatabaseSchemaModel (const QString &provider, const QString &connection, QObject *parent=nullptr) | |
| Constructor for QgsDatabaseSchemaModel, for the specified provider and connection name.  More... | |
| QgsDatabaseSchemaModel (QgsAbstractDatabaseProviderConnection *connection, QObject *parent=nullptr) | |
| Constructor for QgsDatabaseSchemaModel, for the specified connection.  More... | |
| bool | allowEmptySchema () const | 
| Returns trueif the model allows the empty schema ("not set") choice.  More... | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override | 
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override | 
| QModelIndex | index (int row, int column, const QModelIndex &parent) const override | 
| QModelIndex | parent (const QModelIndex &child) const override | 
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override | 
| void | setAllowEmptySchema (bool allowEmpty) | 
| Sets whether an optional empty schema ("not set") option is present in the model.  More... | |
A model containing schemas from a database connection.
This class does not automatically subscribe to database updates. Schemas are queried from the database initially upon model construction. In order to update the listed schemas, QgsDatabaseSchemaModel::refresh() must be manually called.
Definition at line 42 of file qgsdatabaseschemamodel.h.
Model roles.
| Enumerator | |
|---|---|
| RoleEmpty | Entry is an empty entry. | 
Definition at line 49 of file qgsdatabaseschemamodel.h.
| 
 | explicit | 
Constructor for QgsDatabaseSchemaModel, for the specified provider and connection name.
Definition at line 20 of file qgsdatabaseschemamodel.cpp.
| 
 | explicit | 
Constructor for QgsDatabaseSchemaModel, for the specified connection.
Ownership of connection is transferred to the model.
Definition at line 31 of file qgsdatabaseschemamodel.cpp.
| 
 | inline | 
Returns true if the model allows the empty schema ("not set") choice. 
Definition at line 86 of file qgsdatabaseschemamodel.h.
| 
 | override | 
Definition at line 60 of file qgsdatabaseschemamodel.cpp.
| 
 | override | 
Definition at line 67 of file qgsdatabaseschemamodel.cpp.
| 
 | override | 
Definition at line 97 of file qgsdatabaseschemamodel.cpp.
| 
 | override | 
Definition at line 45 of file qgsdatabaseschemamodel.cpp.
| 
 | slot | 
Refreshes the schema list by querying the underlying connection.
Definition at line 126 of file qgsdatabaseschemamodel.cpp.
| 
 | override | 
Definition at line 52 of file qgsdatabaseschemamodel.cpp.
| void QgsDatabaseSchemaModel::setAllowEmptySchema | ( | bool | allowEmpty | ) | 
Sets whether an optional empty schema ("not set") option is present in the model.
Definition at line 107 of file qgsdatabaseschemamodel.cpp.