Class: QgsCoordinateOperationWidget

class qgis.gui.QgsCoordinateOperationWidget

Bases: PyQt5.QtWidgets.QWidget

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

New in version 3.12.

QgsCoordinateOperationWidget(parent: QWidget = None) Constructor for QgsCoordinateOperationWidget.

Methods

actionEvent

availableOperations

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

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

defaultOperation

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

destinationCrs

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

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hasSelection

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

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

makeDefaultSelected

Returns True if the "make default" option is selected.

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

selectedOperation

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

sender

senderSignalIndex

setDestinationCrs

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

setMapCanvas

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

setSelectedOperation

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

setSelectedOperationUsingContext

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

setShowFallbackOption

Sets whether the "allow fallback" operations option is visible.

setShowMakeDefault

Sets whether the "make default" checkbox should be shown.

setSourceCrs

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

sharedPainter

showEvent

sourceCrs

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

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

operationChanged

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

operationDoubleClicked

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

class OperationDetails
class OperationDetails(QgsCoordinateOperationWidget.OperationDetails)

Bases: sip.wrapper

allowFallback
destinationTransformId
isAvailable
proj
sourceTransformId
actionEvent(self, QActionEvent)
availableOperations(self) List[QgsCoordinateOperationWidget.OperationDetails]

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

Return type:

List[QgsCoordinateOperationWidget.OperationDetails]

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
defaultOperation(self) QgsCoordinateOperationWidget.OperationDetails

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

Return type:

QgsCoordinateOperationWidget.OperationDetails

destinationCrs(self) QgsCoordinateReferenceSystem

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

See also

sourceCrs()

Return type:

QgsCoordinateReferenceSystem

destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hasSelection(self) bool

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

Return type:

bool

hideEvent(self, QHideEvent)
initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
makeDefaultSelected(self) bool

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

Return type:

bool

metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
operationChanged

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

operationDoubleClicked

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.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
selectedOperation(self) QgsCoordinateOperationWidget.OperationDetails

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

Return type:

QgsCoordinateOperationWidget.OperationDetails

sender(self) QObject
senderSignalIndex(self) int
setDestinationCrs(self, crs: QgsCoordinateReferenceSystem)

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

See also

destinationCrs()

See also

setSourceCrs()

Parameters:

crs (QgsCoordinateReferenceSystem) –

setMapCanvas(self, canvas: QgsMapCanvas)

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

Parameters:

canvas (QgsMapCanvas) –

setSelectedOperation(self, operation: QgsCoordinateOperationWidget.OperationDetails)

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

Parameters:

operation (QgsCoordinateOperationWidget.OperationDetails) –

setSelectedOperationUsingContext(self, context: QgsCoordinateTransformContext)

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)

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

New in version 3.12.

Parameters:

visible (bool) –

setShowMakeDefault(self, show: bool)

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

Parameters:

show (bool) –

setSourceCrs(self, crs: QgsCoordinateReferenceSystem)

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

See also

sourceCrs()

Parameters:

crs (QgsCoordinateReferenceSystem) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
sourceCrs(self) QgsCoordinateReferenceSystem

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

See also

setSourceCrs()

See also

destinationCrs()

Return type:

QgsCoordinateReferenceSystem

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)