Class: QgsCrsDefinitionWidget

A widget for definition a custom coordinate reference system.

Added in version 3.24.

QgsCrsDefinitionWidget

QgsCrsDefinitionWidget

Class Hierarchy

Inheritance diagram of qgis.gui.QgsCrsDefinitionWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

crs

Returns the current CRS as defined in the widget.

definitionString

Returns the current definition string.

format

Returns the selected CRS format.

setCrs

Sets the current crs to display in the widget.

setDefinitionString

Sets the current definition string.

setFormat

Sets the CRS format.

Signals

crsChanged

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

setCrs()

Return type:

QgsCoordinateReferenceSystem

signal crsChanged[source]

Emitted when the CRS defined in the widget is changed.

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.

Return type:

str

format(self) Qgis.CrsDefinitionFormat[source]

Returns the selected CRS format.

See also

setFormat()

Return type:

Qgis.CrsDefinitionFormat

setCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets the current crs to display in the widget.

See also

crs()

Parameters:

crs (QgsCoordinateReferenceSystem)

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

crs()

Parameters:
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.

Parameters:

definition (Optional[str])

setFormat(self, format: Qgis.CrsDefinitionFormat)[source]

Sets the CRS format.

See also

format()

Parameters:

format (Qgis.CrsDefinitionFormat)