Class: QgsSnapToGridCanvasItem

class qgis.gui.QgsSnapToGridCanvasItem(mapCanvas: QgsMapCanvas)

Bases: PyQt5.QtCore.QObject, qgis._gui.QgsMapCanvasItem

Will automatically be added to the mapCanvas.

Shows a grid on the map canvas given a spatial resolution.

New in version 3.4: Enums

Methods

childEvent
connectNotify
contextMenuEvent
crs The CRS in which the grid should be calculated.
customEvent
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
enabled Enable this item.
focusInEvent
focusOutEvent
hoverEnterEvent
hoverLeaveEvent
hoverMoveEvent
inputMethodEvent
inputMethodQuery
isSignalConnected
itemChange
keyPressEvent
keyReleaseEvent
mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
paint
point A point that will be highlighted on the map canvas.
precision The resolution of the grid in map units.
prepareGeometryChange
receivers
sceneEvent
sceneEventFilter
sender
senderSignalIndex
setCrs The CRS in which the grid should be calculated.
setEnabled Enable this item.
setPoint A point that will be highlighted on the map canvas.
setPrecision The resolution of the grid in map units.
setRenderContextVariables
timerEvent
updateCanvas
updateMicroFocus
wheelEvent

Signals

Attributes

childEvent()
connectNotify()
contextMenuEvent()
crs(self) → QgsCoordinateReferenceSystem

The CRS in which the grid should be calculated. By default will be an invalid QgsCoordinateReferenceSystem and as such equal to the CRS of the map canvas.

customEvent()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enabled(self) → bool

Enable this item. It will be hidden if disabled.

focusInEvent()
focusOutEvent()
hoverEnterEvent()
hoverLeaveEvent()
hoverMoveEvent()
inputMethodEvent()
inputMethodQuery()
isSignalConnected()
itemChange()
keyPressEvent()
keyReleaseEvent()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
paint(self, painter: QPainter)
point(self) → QgsPointXY

A point that will be highlighted on the map canvas. The point needs to be in map coordinates. The closest point on the grid will be highlighted.

precision(self) → float

The resolution of the grid in map units. If a crs has been specified it will be in CRS units.

prepareGeometryChange()
receivers()
sceneEvent()
sceneEventFilter()
sender()
senderSignalIndex()
setCrs(self, crs: QgsCoordinateReferenceSystem)

The CRS in which the grid should be calculated. By default will be an invalid QgsCoordinateReferenceSystem and as such equal to the CRS of the map canvas.

setEnabled(self, enabled: bool)

Enable this item. It will be hidden if disabled.

setPoint(self, point: QgsPointXY)

A point that will be highlighted on the map canvas. The point needs to be in map coordinates. The closest point on the grid will be highlighted.

setPrecision(self, precision: float)

The resolution of the grid in map units. If a crs has been specified it will be in CRS units.

setRenderContextVariables()
timerEvent()
updateCanvas()
updateMicroFocus()
wheelEvent()