QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
An abstract class QIODevice-based sensor classes. More...
#include <qgsiodevicesensor.h>
Public Member Functions | |
QgsIODeviceSensor (QObject *parent=nullptr) | |
Constructor for a abstract QIODevice-based sensor, bound to the specified parent. | |
~QgsIODeviceSensor () override | |
QIODevice * | iODevice () const |
Returns the I/O device. | |
Public Member Functions inherited from QgsAbstractSensor | |
QgsAbstractSensor (QObject *parent=nullptr) | |
Constructor for an abstract sensor, bound to the specified parent. | |
virtual | ~QgsAbstractSensor ()=default |
void | connectSensor () |
Connects the sensor to its source. | |
QgsAbstractSensor::SensorData | data () const |
Returns the latest captured data from the sensor. | |
void | disconnectSensor () |
Disconnects the sensor from its source. | |
QString | errorString () const |
Returns the last error message. | |
QString | id () const |
Returns the sensor ID. | |
QString | name () const |
Returns the user-friendly name identifying the sensor. | |
virtual bool | readPropertiesFromElement (const QDomElement &element, const QDomDocument &document) |
Restores specific sensor type properties from a DOM element. | |
bool | readXml (const QDomElement &element, const QDomDocument &document) |
Restores generic sensor details from a DOM element. | |
void | setData (const QgsAbstractSensor::SensorData &data) |
Sets the latest captured data from the sensor. | |
void | setName (const QString &name) |
Sets the user-friendly name identfying the sensor. | |
void | setStatus (Qgis::DeviceConnectionStatus status) |
Sets the current sensor status. | |
Qgis::DeviceConnectionStatus | status () const |
Returns the current sensor status. | |
virtual QString | type () const |
Returns the sensor type. | |
virtual bool | writePropertiesToElement (QDomElement &element, QDomDocument &document) const |
Write specific sensor type properties into a DOM element. | |
bool | writeXml (QDomElement &parentElement, QDomDocument &document) const |
Write generic sensor properties into a DOM element. | |
Protected Slots | |
virtual void | parseData () |
Parses the data read from the device when available. | |
Protected Member Functions | |
void | initIODevice (QIODevice *device) |
Initiates the I/O device. | |
Protected Member Functions inherited from QgsAbstractSensor | |
virtual void | handleConnect ()=0 |
Handles the connection to the sensor. | |
virtual void | handleDisconnect ()=0 |
Handles the disconnection from the sensor. | |
Additional Inherited Members | |
Signals inherited from QgsAbstractSensor | |
void | dataChanged () |
Emitted when the captured sensor data has changed. | |
void | errorOccurred (const QString &errorString) |
Emitted when an error has occurred. The errorString describes the error. | |
void | nameChanged () |
Emitted when the sensor name has changed. | |
void | statusChanged () |
Emitted when the sensor status has changed. | |
Protected Attributes inherited from QgsAbstractSensor | |
QgsAbstractSensor::SensorData | mData |
QString | mErrorString |
An abstract class QIODevice-based sensor classes.
Definition at line 40 of file qgsiodevicesensor.h.
|
inlineexplicit |
Constructor for a abstract QIODevice-based sensor, bound to the specified parent.
Definition at line 50 of file qgsiodevicesensor.h.
|
override |
Definition at line 27 of file qgsiodevicesensor.cpp.
|
protected |
Initiates the I/O device.
Definition at line 31 of file qgsiodevicesensor.cpp.
QIODevice * QgsIODeviceSensor::iODevice | ( | ) | const |
Returns the I/O device.
Definition at line 41 of file qgsiodevicesensor.cpp.
|
protectedvirtualslot |
Parses the data read from the device when available.
Definition at line 46 of file qgsiodevicesensor.cpp.