Class: QgsMapCanvasItem¶
-
class
qgis.gui.
QgsMapCanvasItem
(mapCanvas: QgsMapCanvas)¶ Bases:
PyQt5.QtWidgets.QGraphicsItem
protected constructor: cannot be constructed directly
An abstract class for items that can be placed on the map canvas.
Enums
Methods
function to be implemented by derived classes
returns canvas item rectangle in map units
sets canvas item rectangle in map units
Sets render context parameters
transformation from map coordinates to screen coordinates
transformation from screen coordinates to map coordinates
schedules map canvas for repaint
called on changed extent or resize event to update position of the item
Signals
Attributes
-
boundingRect
(self) → QRectF¶
-
contextMenuEvent
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
focusInEvent
()¶
-
focusOutEvent
()¶
-
hoverEnterEvent
()¶
-
hoverLeaveEvent
()¶
-
hoverMoveEvent
()¶
-
inputMethodEvent
()¶
-
inputMethodQuery
()¶
-
itemChange
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
paint
(self, painter: QPainter)¶ function to be implemented by derived classes
paint(self, painter: QPainter, option: QStyleOptionGraphicsItem, widget: QWidget = None)
-
prepareGeometryChange
()¶
-
rect
(self) → QgsRectangle¶ returns canvas item rectangle in map units
-
sceneEvent
()¶
-
sceneEventFilter
()¶
-
setRect
(self, r: QgsRectangle, resetRotation: bool = True)¶ sets canvas item rectangle in map units
-
setRenderContextVariables
(self, p: QPainter, context: QgsRenderContext) → bool¶ Sets render context parameters
- Parameters
p – painter for rendering
context – out: configured context
- Returns
true in case of success
-
toCanvasCoordinates
(self, point: QgsPointXY) → QPointF¶ transformation from map coordinates to screen coordinates
-
toMapCoordinates
(self, point: QPoint) → QgsPointXY¶ transformation from screen coordinates to map coordinates
-
updateCanvas
(self)¶ schedules map canvas for repaint
-
updateMicroFocus
()¶
-
updatePosition
(self)¶ called on changed extent or resize event to update position of the item
-
wheelEvent
()¶
-