Class: QgsProviderConnectionModel

class qgis.core.QgsProviderConnectionModel

Bases: PyQt5.QtCore.QAbstractItemModel

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.

New in version 3.14.

QgsProviderConnectionModel(provider: str, parent: QObject = None) Constructor for QgsProviderConnectionModel, for the specified provider.

Warning

The provider must support the connection API methods in its QgsProviderMetadata implementation in order for the model to work correctly.

Methods

allowEmptyConnection

Returns True if the model allows the empty connection ("not set") choice.

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

columnCount

param parent:

connectNotify

createIndex

customEvent

data

param index:

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

index

param row:

isSignalConnected

parent

param child:

persistentIndexList

receivers

resetInternalData

rowCount

param parent:

sender

senderSignalIndex

setAllowEmptyConnection

Sets whether an optional empty connection ("not set") option is present in the model.

timerEvent

Attributes

RoleConfiguration

RoleConnectionName

RoleEmpty

RoleUri

class Role

Bases: int

baseClass

alias of QgsProviderConnectionModel

RoleConfiguration = 258
RoleConnectionName = 256
RoleEmpty = 259
RoleUri = 257
allowEmptyConnection(self) bool

Returns True if the model allows the empty connection (“not set”) choice.

Return type:

bool

QgsProviderConnectionModel.beginInsertColumns(self, QModelIndex, int, int)
QgsProviderConnectionModel.beginInsertRows(self, QModelIndex, int, int)
QgsProviderConnectionModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsProviderConnectionModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsProviderConnectionModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsProviderConnectionModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsProviderConnectionModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
columnCount(self, parent: QModelIndex = QModelIndex()) int
Parameters:

parent (QModelIndex = QModelIndex()) –

Return type:

int

connectNotify(self, QMetaMethod)
QgsProviderConnectionModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
customEvent(self, QEvent)
data(self, index: QModelIndex, role: int = Qt.DisplayRole) Any
Parameters:
  • index (QModelIndex) –

  • role (int = Qt.DisplayRole) –

Return type:

Any

QgsProviderConnectionModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
disconnectNotify(self, QMetaMethod)
encodeData(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
index(self, row: int, column: int, parent: QModelIndex) QModelIndex
Parameters:
  • row (int) –

  • column (int) –

  • parent (QModelIndex) –

Return type:

QModelIndex

isSignalConnected(self, QMetaMethod) bool
parent(self, child: QModelIndex) QModelIndex
Parameters:

child (QModelIndex) –

Return type:

QModelIndex

persistentIndexList(self) List[QModelIndex]
receivers(self, PYQT_SIGNAL) int
resetInternalData(self)
rowCount(self, parent: QModelIndex = QModelIndex()) int
Parameters:

parent (QModelIndex = QModelIndex()) –

Return type:

int

sender(self) QObject
senderSignalIndex(self) int
setAllowEmptyConnection(self, allowEmpty: bool)

Sets whether an optional empty connection (“not set”) option is present in the model.

Parameters:

allowEmpty (bool) –

timerEvent(self, QTimerEvent)