Subgroup: Map

Class: QgsMapToolExtent

class qgis.gui.QgsMapToolExtent(canvas: QgsMapCanvas)

Bases: qgis._gui.QgsMapTool

constructor

A map tool that emits an extent from a rectangle drawn onto the map canvas.

New in version 3.0: Methods

activate
canvasMoveEvent
canvasPressEvent
canvasReleaseEvent
childEvent
connectNotify
customEvent
deactivate
disconnectNotify
extent Returns the current extent drawn onto the canvas.
flags
isSignalConnected
ratio Returns the current fixed aspect ratio to be used when dragging extent onto the canvas.
receivers
sender
senderSignalIndex
setRatio Sets a fixed aspect ratio to be used when dragging extent onto the canvas.
timerEvent
toCanvasCoordinates
toLayerCoordinates
toMapCoordinates
toMapCoordinatesV2

Signals

extentChanged signal emitted on extent change [signal]

Attributes

activate(self)
canvasMoveEvent(self, e: QgsMapMouseEvent)
canvasPressEvent(self, e: QgsMapMouseEvent)
canvasReleaseEvent(self, e: QgsMapMouseEvent)
childEvent()
connectNotify()
customEvent()
deactivate(self)
disconnectNotify()
extent(self) → QgsRectangle

Returns the current extent drawn onto the canvas.

extentChanged

signal emitted on extent change [signal]

flags(self) → QgsMapTool.Flags
isSignalConnected()
ratio(self) → QSize

Returns the current fixed aspect ratio to be used when dragging extent onto the canvas. If the aspect ratio isn’t fixed, the width and height will be set to zero.

receivers()
sender()
senderSignalIndex()
setRatio(self, ratio: QSize)

Sets a fixed aspect ratio to be used when dragging extent onto the canvas. To unset a fixed aspect ratio, set the width and height to zero.

Parameters:ratio – aspect ratio’s width and height
timerEvent()
toCanvasCoordinates()
toLayerCoordinates()
toMapCoordinates()
toMapCoordinatesV2()