QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Registry of available sensor types. More...
#include <qgssensorregistry.h>
Signals | |
void | sensorAdded (const QString &type, const QString &name) |
Emitted whenever a new sensor type is added to the registry, with the specified type and visible name. | |
Public Member Functions | |
QgsSensorRegistry (const QgsSensorRegistry &rh)=delete | |
QgsSensorRegistry (QObject *parent=nullptr) | |
Creates a new empty item registry. | |
~QgsSensorRegistry () override | |
bool | addSensorType (QgsSensorAbstractMetadata *metadata) |
Registers a new sensor type. | |
QgsAbstractSensor * | createSensor (const QString &type, QObject *parent=nullptr) const |
Creates a new instance of a sensor given the type. | |
QgsSensorRegistry & | operator= (const QgsSensorRegistry &rh)=delete |
bool | populate () |
Populates the registry with standard sensor types. | |
bool | removeSensorType (const QString &type) |
Removes a new a sensor type from the registry. | |
QgsSensorAbstractMetadata * | sensorMetadata (const QString &type) const |
Returns the metadata for the specified sensor type. | |
QMap< QString, QString > | sensorTypes () const |
Returns a map of available sensor types to translated name. | |
Registry of available sensor types.
QgsSensorRegistry is not usually directly created, but rather accessed through QgsApplication::sensorRegistry().
A companion class, QgsSensorGuiRegistry, handles the GUI behavior of sensors.
Definition at line 131 of file qgssensorregistry.h.
QgsSensorRegistry::QgsSensorRegistry | ( | QObject * | parent = nullptr | ) |
Creates a new empty item registry.
QgsSensorRegistry is not usually directly created, but rather accessed through QgsApplication::sensorRegistry().
Definition at line 25 of file qgssensorregistry.cpp.
|
override |
Definition at line 30 of file qgssensorregistry.cpp.
|
delete |
bool QgsSensorRegistry::addSensorType | ( | QgsSensorAbstractMetadata * | metadata | ) |
Registers a new sensor type.
Definition at line 54 of file qgssensorregistry.cpp.
QgsAbstractSensor * QgsSensorRegistry::createSensor | ( | const QString & | type, |
QObject * | parent = nullptr |
||
) | const |
Creates a new instance of a sensor given the type.
Definition at line 83 of file qgssensorregistry.cpp.
|
delete |
bool QgsSensorRegistry::populate | ( | ) |
Populates the registry with standard sensor types.
If called on a non-empty registry then this will have no effect and will return false
.
Definition at line 35 of file qgssensorregistry.cpp.
bool QgsSensorRegistry::removeSensorType | ( | const QString & | type | ) |
Removes a new a sensor type from the registry.
Definition at line 64 of file qgssensorregistry.cpp.
|
signal |
Emitted whenever a new sensor type is added to the registry, with the specified type and visible name.
QgsSensorAbstractMetadata * QgsSensorRegistry::sensorMetadata | ( | const QString & | type | ) | const |
Returns the metadata for the specified sensor type.
Returns nullptr
if a corresponding type was not found in the registry.
Definition at line 49 of file qgssensorregistry.cpp.
QMap< QString, QString > QgsSensorRegistry::sensorTypes | ( | ) | const |
Returns a map of available sensor types to translated name.
Definition at line 91 of file qgssensorregistry.cpp.