Class: QgsGeometryRubberBand¶
- class qgis.gui.QgsGeometryRubberBand¶
Bases:
QgsMapCanvasItem
A rubberband class for
QgsAbstractGeometry
(considering curved geometries).Methods
Returns a pointer to the geometry
Returns which geometry is handled by the rubber band, polygon or line
Moves vertex to new position (in map coordinates)
- param painter
Sets brush style
Sets fill color for vertex markers
Sets geometry (takes ownership).
Sets which geometry is handled by the rubber band, polygon or line
Sets vertex marker icon type
Sets pen style
Sets render context parameters
Sets stroke color for vertex markers
Sets stroke width
Sets whether the vertices are drawn
schedules map canvas for repaint
Attributes
- ICON_BOX = 3¶
- ICON_CIRCLE = 4¶
- ICON_CROSS = 1¶
- ICON_FULL_BOX = 5¶
- ICON_NONE = 0¶
- ICON_X = 2¶
- class IconType¶
Bases:
int
- contextMenuEvent(self, QGraphicsSceneContextMenuEvent)¶
- dragEnterEvent(self, QGraphicsSceneDragDropEvent)¶
- dragLeaveEvent(self, QGraphicsSceneDragDropEvent)¶
- dragMoveEvent(self, QGraphicsSceneDragDropEvent)¶
- dropEvent(self, QGraphicsSceneDragDropEvent)¶
- focusInEvent(self, QFocusEvent)¶
- focusOutEvent(self, QFocusEvent)¶
- geometry(self) QgsAbstractGeometry ¶
Returns a pointer to the geometry
- Return type
- geometryType(self) QgsWkbTypes.GeometryType ¶
Returns which geometry is handled by the rubber band, polygon or line
- Return type
- hoverEnterEvent(self, QGraphicsSceneHoverEvent)¶
- hoverLeaveEvent(self, QGraphicsSceneHoverEvent)¶
- hoverMoveEvent(self, QGraphicsSceneHoverEvent)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- inputMethodQuery(self, Qt.InputMethodQuery) Any ¶
- itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)¶
- mouseMoveEvent(self, QGraphicsSceneMouseEvent)¶
- mousePressEvent(self, QGraphicsSceneMouseEvent)¶
- mouseReleaseEvent(self, QGraphicsSceneMouseEvent)¶
- moveVertex(self, id: QgsVertexId, newPos: QgsPoint)¶
Moves vertex to new position (in map coordinates)
- Parameters
id (QgsVertexId) –
newPos (QgsPoint) –
- paint(self, painter: QPainter)¶
- Parameters
painter (QPainter) –
- prepareGeometryChange(self)¶
- sceneEvent(self, QEvent) bool ¶
- sceneEventFilter(self, QGraphicsItem, QEvent) bool ¶
- setBrushStyle(self, brushStyle: Qt.BrushStyle)¶
Sets brush style
- Parameters
brushStyle (Qt.BrushStyle) –
- setFillColor(self, c: Union[QColor, Qt.GlobalColor, QGradient])¶
Sets fill color for vertex markers
- Parameters
c (Union[QColor) –
- setGeometry(self, geom: QgsAbstractGeometry)¶
Sets geometry (takes ownership). Geometry is expected to be in map coordinates
- Parameters
geom (QgsAbstractGeometry) –
- setGeometryType(self, geometryType: QgsWkbTypes.GeometryType)¶
Sets which geometry is handled by the rubber band, polygon or line
- Parameters
geometryType (QgsWkbTypes.GeometryType) –
- setIconType(self, iconType: QgsGeometryRubberBand.IconType)¶
Sets vertex marker icon type
- Parameters
iconType (QgsGeometryRubberBand.IconType) –
- setLineStyle(self, penStyle: Qt.PenStyle)¶
Sets pen style
- Parameters
penStyle (Qt.PenStyle) –
- 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
- setStrokeColor(self, c: Union[QColor, Qt.GlobalColor, QGradient])¶
Sets stroke color for vertex markers
- Parameters
c (Union[QColor) –
- setStrokeWidth(self, width: int)¶
Sets stroke width
- Parameters
width (int) –
- setVertexDrawingEnabled(self, isVerticesDrawn: bool)¶
Sets whether the vertices are drawn
- Parameters
isVerticesDrawn (bool) –
- updateCanvas(self)¶
schedules map canvas for repaint
- updateMicroFocus(self)¶
- updatePosition(self)¶
- wheelEvent(self, QGraphicsSceneWheelEvent)¶