Class: QgsCrsDefinitionWidget

A widget for defining 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

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]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

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()

setCrs(self, crs: QgsCoordinateReferenceSystem, nativeFormat: Qgis.CrsDefinitionFormat) 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:

crs (QgsCoordinateReferenceSystem)

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)