Class: QgsGeometryWidget¶
A widget for storing and interacting with a QgsGeometry
object.
This widget can be used in places where an dialog needs to expose a geometry value to users, and allow them to safely interact with it (such as changing the stored geometry value).
Added in version 3.30.
Class Hierarchy¶
Base classes¶
- class qgis.gui.QgsGeometryWidget[source]¶
Bases:
QWidget- __init__(parent: QWidget | None = None)
Constructor for QgsGeometryWidget, with the specified
parentwidget.- Parameters:
parent (Optional[QWidget] = None)
- acceptedWkbTypes(self) List[Qgis.WkbType]¶
Returns the list of WKB geometry types which are permitted for the widget.
See also
- Return type:
- copyAsGeoJson(self)[source]¶
Copies the current geometry value to the clipboard, as a GeoJSON string.
See also
- copyAsWkt(self)[source]¶
Copies the current geometry value to the clipboard, as a WKT string.
See also
- geometryValue(self) QgsReferencedGeometry[source]¶
Returns the current geometry value for the widget.
Warning
This should not be confused with QWidget.geometry(), which returns the placement and size of the widget itself.
See also
See also
- Return type:
- signal geometryValueChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- isReadOnly(self) bool[source]¶
Returns whether the widget is in a read-only state.
See also
- Return type:
bool
- setAcceptedWkbTypes(self, types: Iterable[Qgis.WkbType])[source]¶
Sets the list of WKB geometry
typeswhich are permitted for the widget.See also
- Parameters:
types (Iterable[Qgis.WkbType])
- setGeometryValue(self, geometry: QgsReferencedGeometry)[source]¶
Sets the current
geometryvalue for the widget.Warning
This should not be confused with QWidget.setGeometry(), which modifies the placement and size of the widget itself.
See also
See also
- Parameters:
geometry (QgsReferencedGeometry)