QGIS API Documentation 3.41.0-Master (d5b93354e9c)
Loading...
Searching...
No Matches
Signals | Public Member Functions | List of all members
QgsSensorRegistry Class Reference

Registry of available sensor types. More...

#include <qgssensorregistry.h>

Inheritance diagram for QgsSensorRegistry:
Inheritance graph
[legend]

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.
 
QgsAbstractSensorcreateSensor (const QString &type, QObject *parent=nullptr) const
 Creates a new instance of a sensor given the type.
 
QgsSensorRegistryoperator= (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.
 
QgsSensorAbstractMetadatasensorMetadata (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.
 

Detailed Description

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.

Since
QGIS 3.32

Definition at line 131 of file qgssensorregistry.h.

Constructor & Destructor Documentation

◆ QgsSensorRegistry() [1/2]

QgsSensorRegistry::QgsSensorRegistry ( QObject *  parent = nullptr)

Creates a new empty item registry.

QgsSensorRegistry is not usually directly created, but rather accessed through QgsApplication::sensorRegistry().

See also
populate()

Definition at line 25 of file qgssensorregistry.cpp.

◆ ~QgsSensorRegistry()

QgsSensorRegistry::~QgsSensorRegistry ( )
override

Definition at line 30 of file qgssensorregistry.cpp.

◆ QgsSensorRegistry() [2/2]

QgsSensorRegistry::QgsSensorRegistry ( const QgsSensorRegistry rh)
delete

Member Function Documentation

◆ addSensorType()

bool QgsSensorRegistry::addSensorType ( QgsSensorAbstractMetadata metadata)

Registers a new sensor type.

Note
Takes ownership of the metadata instance.

Definition at line 54 of file qgssensorregistry.cpp.

◆ createSensor()

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.

◆ operator=()

QgsSensorRegistry & QgsSensorRegistry::operator= ( const QgsSensorRegistry rh)
delete

◆ populate()

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.

◆ removeSensorType()

bool QgsSensorRegistry::removeSensorType ( const QString &  type)

Removes a new a sensor type from the registry.

Definition at line 64 of file qgssensorregistry.cpp.

◆ sensorAdded

void QgsSensorRegistry::sensorAdded ( const QString &  type,
const QString &  name 
)
signal

Emitted whenever a new sensor type is added to the registry, with the specified type and visible name.

◆ sensorMetadata()

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.

◆ sensorTypes()

QMap< QString, QString > QgsSensorRegistry::sensorTypes ( ) const

Returns a map of available sensor types to translated name.

Definition at line 91 of file qgssensorregistry.cpp.


The documentation for this class was generated from the following files: