Class: QgsCoordinateOperationWidget

A widget for selecting the coordinate operation to use when transforming between a source and destination coordinate reference system.

Added in version 3.12.

QgsCoordinateOperationWidget

QgsCoordinateOperationWidget

Class Hierarchy

Inheritance diagram of qgis.gui.QgsCoordinateOperationWidget

Base classes

QWidget

QObject

QPaintDevice

class qgis.gui.QgsCoordinateOperationWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsCoordinateOperationWidget.

Parameters:

parent (Optional[QWidget] = None)

class OperationDetails

Bases: object

Coordinate operation details

allowFallback: bool
destinationTransformId: int
isAvailable: bool
proj: str
sourceTransformId: int
availableOperations(self) List[QgsCoordinateOperationWidget.OperationDetails]

Returns a list of the available operations shown in the widget.

Return type:

List[QgsCoordinateOperationWidget.OperationDetails]

defaultOperation(self) QgsCoordinateOperationWidget.OperationDetails[source]

Returns the details of the default operation suggested by the widget.

Return type:

QgsCoordinateOperationWidget.OperationDetails

destinationCrs(self) QgsCoordinateReferenceSystem[source]

Returns the destination CRS for the operations shown in the widget.

See also

sourceCrs()

Return type:

QgsCoordinateReferenceSystem

hasSelection(self) bool[source]

Returns True if there is a valid selection in the widget.

Return type:

bool

makeDefaultSelected(self) bool[source]

Returns True if the “make default” option is selected.

Return type:

bool

signal operationChanged[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.

signal operationDoubleClicked[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.

selectedOperation(self) QgsCoordinateOperationWidget.OperationDetails[source]

Returns the details of the operation currently selected within the widget.

Return type:

QgsCoordinateOperationWidget.OperationDetails

setDestinationCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets the destination crs for the operations shown in the widget.

See also

destinationCrs()

See also

setSourceCrs()

Parameters:

crs (QgsCoordinateReferenceSystem)

setMapCanvas(self, canvas: QgsMapCanvas | None)[source]

Sets a map canvas to link to the widget, which allows the widget’s choices to reflect the current canvas state.

Parameters:

canvas (Optional[QgsMapCanvas])

setSelectedOperation(self, operation: QgsCoordinateOperationWidget.OperationDetails)[source]

Sets the details of the operation currently selected within the widget.

Parameters:

operation (QgsCoordinateOperationWidget.OperationDetails)

setSelectedOperationUsingContext(self, context: QgsCoordinateTransformContext)[source]

Automatically sets the selected operation using the settings encapsulated in a transform context.

If no matching operations are found within the context then the defaultOperation() will be selected.

Parameters:

context (QgsCoordinateTransformContext)

setShowFallbackOption(self, visible: bool)[source]

Sets whether the “allow fallback” operations option is visible.

Added in version 3.12.

Parameters:

visible (bool)

setShowMakeDefault(self, show: bool)[source]

Sets whether the “make default” checkbox should be shown.

Parameters:

show (bool)

setSourceCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets the source crs for the operations shown in the widget.

See also

sourceCrs()

Parameters:

crs (QgsCoordinateReferenceSystem)

sourceCrs(self) QgsCoordinateReferenceSystem[source]

Returns the source CRS for the operations shown in the widget.

See also

setSourceCrs()

See also

destinationCrs()

Return type:

QgsCoordinateReferenceSystem