Class: QgsCoordinateReferenceSystemModel

class qgis.gui.QgsCoordinateReferenceSystemModel

Bases: PyQt5.QtCore.QAbstractItemModel

A tree model for display of known coordinate reference systems.

Added in version 3.34.

QgsCoordinateReferenceSystemModel(parent: QObject = None) Constructor for QgsCoordinateReferenceSystemModel, with the specified parent object.

Enums

CustomRole

Bases: enum.IntEnum

Roles

alias of CustomRole

Methods

addCustomCrs

Adds a custom crs to the model.

authIdToIndex

Retrieves the model index corresponding to a CRS with the specified authId.

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

columnCount

rtype:

int

connectNotify

createIndex

customEvent

data

param index:

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

flags

param index:

headerData

param section:

index

param row:

isSignalConnected

parent

param index:

persistentIndexList

receivers

resetInternalData

rowCount

param parent:

sender

senderSignalIndex

timerEvent

class CustomRole(value)

Bases: enum.IntEnum

Custom model roles.

Note

Prior to QGIS 3.36 this was available as QgsCoordinateReferenceSystemModel.Roles

Added in version 3.36.

  • RoleNodeType: Corresponds to the node’s type

  • RoleName: The coordinate reference system name

  • RoleAuthId: The coordinate reference system authority name and id

  • RoleDeprecated: True if the CRS is deprecated

  • RoleType: The coordinate reference system type

  • RoleGroupId: The node ID (for group nodes)

  • RoleWkt: The coordinate reference system’s WKT representation. This is only used for non-standard CRS (i.e. those not present in the database).

  • RoleProj: The coordinate reference system’s PROJ representation. This is only used for non-standard CRS (i.e. those not present in the database).

baseClass

alias of QgsCoordinateReferenceSystemModel

Roles

alias of CustomRole

addCustomCrs(self, crs: QgsCoordinateReferenceSystem) QModelIndex

Adds a custom crs to the model.

This method can be used to add CRS which aren’t present in either the standard PROJ SRS database or the user’s custom CRS database to the model.

Parameters:

crs (QgsCoordinateReferenceSystem)

Return type:

QModelIndex

authIdToIndex(self, authId: str) QModelIndex

Retrieves the model index corresponding to a CRS with the specified authId.

Returns an invalid index if the CRS was not found.

Parameters:

authId (str)

Return type:

QModelIndex

beginInsertColumns(self, QModelIndex, int, int)
beginInsertRows(self, QModelIndex, int, int)
beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) bool
beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) bool
beginRemoveColumns(self, QModelIndex, int, int)
beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
columnCount(self, QModelIndex=QModelIndex()) int
Return type:

int

connectNotify(self, QMetaMethod)
createIndex(self, int, int, object: object = 0) QModelIndex
customEvent(self, QEvent)
data(self, index: QModelIndex, role: int) Any
Parameters:
  • index (QModelIndex)

  • role (int)

Return type:

Any

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)
flags(self, index: QModelIndex) Qt.ItemFlags
Parameters:

index (QModelIndex)

Return type:

Qt.ItemFlags

headerData(self, section: int, orientation: Qt.Orientation, role: int) Any
Parameters:
  • section (int)

  • orientation (Qt.Orientation)

  • role (int)

Return type:

Any

index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) QModelIndex
Parameters:
  • row (int)

  • column (int)

  • parent (QModelIndex = QModelIndex())

Return type:

QModelIndex

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

index (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
timerEvent(self, QTimerEvent)