Class: QgsSensorGuiRegistry¶
Registry of available sensor GUI behavior.
QgsSensorGuiRegistry
is not usually directly created, but
rather accessed through QgsGui.sensorGuiRegistry()
.
This acts as a companion to QgsSensorRegistry
, handling only
the components related to the GUI behavior of sensors.
Added in version 3.32.
Class Hierarchy¶
Base classes¶
Methods
Registers the GUI metadata for a new sensor type. |
|
Creates a new instance of a sensor given the type. |
|
Creates a new instance of a sensor configuration widget for the specified sensor. |
|
Populates the registry with standard sensor types. |
|
Returns the metadata for the specified sensor type. |
|
Returns a list of sensor types handled by the registry. |
Signals
Emitted whenever a new sensor type is added to the registry, with the specified type. |
- class qgis.gui.QgsSensorGuiRegistry[source]¶
Bases:
QObject
- __init__(parent: QObject | None = None)
Creates a new empty sensor GUI registry.
QgsSensorGuiRegistry is not usually directly created, but rather accessed through
QgsGui.sensorGuiRegistry()
.- Parameters:
parent (Optional[QObject] = None)
- addSensorGuiMetadata(self, metadata: QgsSensorAbstractGuiMetadata | None) bool [source]¶
Registers the GUI metadata for a new sensor type. Takes ownership of the metadata instance.
- Parameters:
metadata (Optional[QgsSensorAbstractGuiMetadata])
- Return type:
bool
- createSensor(self, type: str | None, parent: QObject | None = None) QgsAbstractSensor | None [source]¶
Creates a new instance of a sensor given the
type
.- Parameters:
type (Optional[str])
parent (Optional[QObject] = None)
- Return type:
Optional[QgsAbstractSensor]
- createSensorWidget(self, sensor: QgsAbstractSensor | None) QgsAbstractSensorWidget | None [source]¶
Creates a new instance of a sensor configuration widget for the specified
sensor
. Thesensor
doesn’t need to live for the duration of the widget, it is only used when creating the configuration widget to match a sensor type and initiate the widget to match thesensor
settings.- Parameters:
sensor (Optional[QgsAbstractSensor])
- Return type:
Optional[QgsAbstractSensorWidget]
- populate(self) bool [source]¶
Populates the registry with standard sensor types. If called on a non-empty registry then this will have no effect and will return
False
.- Return type:
bool
- signal sensorAdded(type: str, name: str)[source]¶
Emitted whenever a new sensor type is added to the registry, with the specified
type
.- Parameters:
type (str)
name (str)
- sensorMetadata(self, type: str | None) QgsSensorAbstractGuiMetadata | None [source]¶
Returns the metadata for the specified sensor
type
. ReturnsNone
if a corresponding sensor type was not found in the registry.- Parameters:
type (Optional[str])
- Return type:
Optional[QgsSensorAbstractGuiMetadata]
- sensorTypes(self) Dict[str, str] ¶
Returns a list of sensor types handled by the registry.
- Return type:
Dict[str, str]