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

Abstract Methods

createSensor

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

setSensor

Sets the widget settings to match a given sensor.

updateSensor

Updates an existing sensor to match the settings defined in the widget.

Signals

changed

Emitted whenever configuration changes happened on this sensor configuration.

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]

Emitted whenever configuration changes happened on this sensor configuration.

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