Class: QgsAbstractSensorWidget

Base class for widgets which allow control over the properties of sensors.

Added in version 3.32.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: createSensor(), setSensor(), updateSensor()

Class Hierarchy

Inheritance diagram of qgis.gui.QgsAbstractSensorWidget

Base classes

QWidget

QObject

QPaintDevice

class qgis.gui.QgsAbstractSensorWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsAbstractSensorWidget.

Parameters:

parent (Optional[QWidget] = None) – parent widget

signal changed[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.

abstract createSensor(self) QgsAbstractSensor | None[source]

Creates a new sensor matching the settings defined in the widget.

Return type:

Optional[QgsAbstractSensor]

abstract setSensor(self, sensor: QgsAbstractSensor | None) bool[source]

Sets the widget settings to match a given sensor. If True is returned, sensor was an acceptable type and the widget has been updated to match the sensor’s properties.

If False is returned, then the widget could not be successfully updated to show the properties of sensor.

Parameters:

sensor (Optional[QgsAbstractSensor])

Return type:

bool

abstract updateSensor(self, sensor: QgsAbstractSensor | None) bool[source]

Updates an existing sensor to match the settings defined in the widget. If True is returned, the sensor was successfully updated.

If False is returned, then the widget could not successfully update the sensor.

Parameters:

sensor (Optional[QgsAbstractSensor])

Return type:

bool