Class: QgsGeometryRubberBand¶
A rubberband class for QgsAbstractGeometry (considering
curved geometries).
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
An abstract class for items that can be placed on the map canvas. |
|
Classes
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) |
|
Sets brush style |
|
Sets fill color for vertex markers |
|
Sets which geometry is handled by the rubber band, polygon or line |
|
Sets vertex marker icon type |
|
Sets pen style |
|
Sets stroke color for vertex markers |
|
Sets stroke width |
|
Sets whether the vertices are drawn |
Virtual Methods
In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsGeometryRubberBand. See the FAQ for more details.
Sets geometry (takes ownership). |
Attributes
- class qgis.gui.QgsGeometryRubberBand[source]¶
Bases:
QgsMapCanvasItem- __init__(mapCanvas: QgsMapCanvas | None, geomType: Qgis.GeometryType = Qgis.GeometryType.Line)
Constructor for QgsGeometryRubberBand of the given
geomType, shown in the specifiedmapCanvas.- Parameters:
mapCanvas (Optional[QgsMapCanvas])
geomType (Qgis.GeometryType = Qgis.GeometryType.Line)
- ICON_BOX = 3¶
- ICON_CIRCLE = 4¶
- ICON_CROSS = 1¶
- ICON_FULL_BOX = 5¶
- ICON_NONE = 0¶
- ICON_X = 2¶
- class IconType¶
Bases:
int
- geometry(self) QgsAbstractGeometry | None[source]¶
Returns a pointer to the geometry
- Return type:
Optional[QgsAbstractGeometry]
- geometryType(self) Qgis.GeometryType[source]¶
Returns which geometry is handled by the rubber band, polygon or line
- Return type:
- moveVertex(self, id: QgsVertexId, newPos: QgsPoint)[source]¶
Moves vertex to new position (in map coordinates)
- Parameters:
id (QgsVertexId)
newPos (QgsPoint)
- setBrushStyle(self, brushStyle: Qt.BrushStyle)[source]¶
Sets brush style
- Parameters:
brushStyle (Qt.BrushStyle)
- setFillColor(self, c: QColor | Qt.GlobalColor)[source]¶
Sets fill color for vertex markers
- Parameters:
c (Union[QColor, Qt.GlobalColor])
- virtual setGeometry(self, geom: QgsAbstractGeometry | None)[source]¶
Sets geometry (takes ownership). Geometry is expected to be in map coordinates
- Parameters:
geom (Optional[QgsAbstractGeometry])
- setGeometryType(self, geometryType: Qgis.GeometryType)[source]¶
Sets which geometry is handled by the rubber band, polygon or line
- Parameters:
geometryType (Qgis.GeometryType)
- setIconType(self, iconType: QgsGeometryRubberBand.IconType)[source]¶
Sets vertex marker icon type
- Parameters:
iconType (QgsGeometryRubberBand.IconType)
- setLineStyle(self, penStyle: Qt.PenStyle)[source]¶
Sets pen style
- Parameters:
penStyle (Qt.PenStyle)