Class: QgsCrsDefinitionWidget¶
A widget for defining a custom coordinate reference system.
Added in version 3.24.

QgsCrsDefinitionWidget¶
Class Hierarchy¶
Base classes¶
Methods
Returns the current CRS as defined in the widget. |
|
Returns the current definition string. |
|
Returns the selected CRS format. |
|
Sets the current crs to display in the widget. |
|
Sets the current definition string. |
|
Sets the CRS format. |
Signals
Emitted when the CRS defined in the widget is changed. |
- class qgis.gui.QgsCrsDefinitionWidget[source]¶
Bases:
QWidget
- __init__(parent: QWidget | None = None)
Constructor for QgsCrsDefinitionWidget, with the specified
parent
widget.- Parameters:
parent (Optional[QWidget] = None)
- crs(self) QgsCoordinateReferenceSystem [source]¶
Returns the current CRS as defined in the widget.
An invalid CRS may be returned if no CRS is defined in the widget.
See also
- Return type:
- definitionString(self) str [source]¶
Returns the current definition string.
This represents the unaltered user-entered definition string, which may represent either a WKT or PROJ string (see
format()
), and may not represent a valid CRS definition.See also
- Return type:
str
- format(self) Qgis.CrsDefinitionFormat [source]¶
Returns the selected CRS format.
See also
- Return type:
- setCrs(self, crs: QgsCoordinateReferenceSystem)[source]¶
Sets the current
crs
to display in the widget.See also
- Parameters:
- setCrs(self, crs: QgsCoordinateReferenceSystem, nativeFormat: Qgis.CrsDefinitionFormat)[source]
Sets the current
crs
to display in the widget.The
nativeFormat
argument specifies the format (e.g. WKT or PROJ) is natively associated with the custom CRS.See also
- Parameters:
nativeFormat (Qgis.CrsDefinitionFormat)
- setDefinitionString(self, definition: str | None)[source]¶
Sets the current
definition
string.This represents the unaltered user-entered definition string, which may represent either a WKT or PROJ string (see
format()
), and may not represent a valid CRS definition.See also
- Parameters:
definition (Optional[str])
- setFormat(self, format: Qgis.CrsDefinitionFormat)[source]¶
Sets the CRS
format
.See also
- Parameters:
format (Qgis.CrsDefinitionFormat)