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 specifiedparent
object.Enums
Bases:
enum.IntEnum
alias of
CustomRole
Methods
Adds a custom
crs
to the model.Retrieves the model index corresponding to a CRS with the specified
authId
.- rtype:
int
- param index:
- param index:
- param section:
- param row:
- param index:
- param parent:
- 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 typeRoleName
: The coordinate reference system nameRoleAuthId
: The coordinate reference system authority name and idRoleDeprecated
:True
if the CRS is deprecatedRoleType
: The coordinate reference system typeRoleGroupId
: 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:
- 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)¶