QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
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 cannot be copied. | |
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 |
QgsSensorRegistry cannot be copied. | |
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 132 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 24 of file qgssensorregistry.cpp.
|
override |
Definition at line 29 of file qgssensorregistry.cpp.
|
delete |
QgsSensorRegistry cannot be copied.
bool QgsSensorRegistry::addSensorType | ( | QgsSensorAbstractMetadata * | metadata | ) |
Registers a new sensor type.
Definition at line 53 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 82 of file qgssensorregistry.cpp.
|
delete |
QgsSensorRegistry cannot be copied.
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 34 of file qgssensorregistry.cpp.
bool QgsSensorRegistry::removeSensorType | ( | const QString & | type | ) |
Removes a new a sensor type from the registry.
Definition at line 63 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 48 of file qgssensorregistry.cpp.
QMap< QString, QString > QgsSensorRegistry::sensorTypes | ( | ) | const |
Returns a map of available sensor types to translated name.
Definition at line 90 of file qgssensorregistry.cpp.