Class: QgsProviderConnectionModel¶
A model containing registered connection names for a specific data provider.
Warning
The provider must support the connection API methods in its QgsProviderMetadata
implementation
in order for the model to work correctly.
Added in version 3.14.
Class Hierarchy¶
Base classes¶
Enums
Custom model roles. |
|
alias of |
Methods
Returns |
|
Sets whether an optional empty connection ("not set") option is present in the model. |
- class qgis.core.QgsProviderConnectionModel[source]¶
Bases:
QAbstractItemModel
- __init__(provider: str | None, parent: QObject | None = None)
Constructor for QgsProviderConnectionModel, for the specified
provider
.Warning
The
provider
must support the connection API methods in itsQgsProviderMetadata
implementation in order for the model to work correctly.- Parameters:
provider (Optional[str])
parent (Optional[QObject] = None)
- class CustomRole(*values)¶
Bases:
IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsProviderConnectionModel.Role
Added in version 3.36.
ConnectionName
: Connection nameAvailable as
QgsProviderConnectionModel.RoleConnectionName
in older QGIS releases.Uri
: Connection URI stringAvailable as
QgsProviderConnectionModel.RoleUri
in older QGIS releases.Configuration
: Connection configuration variant mapAvailable as
QgsProviderConnectionModel.RoleConfiguration
in older QGIS releases.Empty
: Entry is an empty entryAvailable as
QgsProviderConnectionModel.RoleEmpty
in older QGIS releases.
- Role¶
alias of
CustomRole
- allowEmptyConnection(self) bool [source]¶
Returns
True
if the model allows the empty connection (“not set”) choice.See also
- Return type:
bool