QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
Public Member Functions | Protected Slots | Protected Member Functions | List of all members
QgsIODeviceSensor Class Reference

An abstract class QIODevice-based sensor classes. More...

#include <qgsiodevicesensor.h>

Inheritance diagram for QgsIODeviceSensor:
Inheritance graph
[legend]

Public Member Functions

 QgsIODeviceSensor (QObject *parent=nullptr)
 Constructor for a abstract QIODevice-based sensor, bound to the specified parent. More...
 
 ~QgsIODeviceSensor () override
 
QIODevice * iODevice () const
 Returns the I/O device. More...
 
- Public Member Functions inherited from QgsAbstractSensor
 QgsAbstractSensor (QObject *parent=nullptr)
 Constructor for an abstract sensor, bound to the specified parent. More...
 
virtual ~QgsAbstractSensor ()=default
 
void connectSensor ()
 Connects the sensor to its source. More...
 
QgsAbstractSensor::SensorData data () const
 Returns the latest captured data from the sensor. More...
 
void disconnectSensor ()
 Disconnects the sensor from its source. More...
 
QString errorString () const
 Returns the last error message. More...
 
QString id () const
 Returns the sensor ID. More...
 
QString name () const
 Returns the user-friendly name identifying the sensor. More...
 
virtual bool readPropertiesFromElement (const QDomElement &element, const QDomDocument &document)
 Restores specific sensor type properties from a DOM element. More...
 
bool readXml (const QDomElement &element, const QDomDocument &document)
 Restores generic sensor details from a DOM element. More...
 
void setData (const QgsAbstractSensor::SensorData &data)
 Sets the latest captured data from the sensor. More...
 
void setName (const QString &name)
 Sets the user-friendly name identfying the sensor. More...
 
void setStatus (Qgis::DeviceConnectionStatus status)
 Sets the current sensor status. More...
 
Qgis::DeviceConnectionStatus status () const
 Returns the current sensor status. More...
 
virtual QString type () const
 Returns the sensor type. More...
 
virtual bool writePropertiesToElement (QDomElement &element, QDomDocument &document) const
 Write specific sensor type properties into a DOM element. More...
 
bool writeXml (QDomElement &parentElement, QDomDocument &document) const
 Write generic sensor properties into a DOM element. More...
 

Protected Slots

virtual void parseData ()
 Parses the data read from the device when available. More...
 

Protected Member Functions

void initIODevice (QIODevice *device)
 Initiates the I/O device. More...
 
- Protected Member Functions inherited from QgsAbstractSensor
virtual void handleConnect ()=0
 Handles the connection to the sensor. More...
 
virtual void handleDisconnect ()=0
 Handles the disconnection from the sensor. More...
 

Additional Inherited Members

- Signals inherited from QgsAbstractSensor
void dataChanged ()
 Emitted when the captured sensor data has changed. More...
 
void errorOccurred (const QString &errorString)
 Emitted when an error has occurred. The errorString describes the error. More...
 
void nameChanged ()
 Emitted when the sensor name has changed. More...
 
void statusChanged ()
 Emitted when the sensor status has changed. More...
 
- Protected Attributes inherited from QgsAbstractSensor
QgsAbstractSensor::SensorData mData
 
QString mErrorString
 

Detailed Description

An abstract class QIODevice-based sensor classes.

Since
QGIS 3.32

Definition at line 40 of file qgsiodevicesensor.h.

Constructor & Destructor Documentation

◆ QgsIODeviceSensor()

QgsIODeviceSensor::QgsIODeviceSensor ( QObject *  parent = nullptr)
inlineexplicit

Constructor for a abstract QIODevice-based sensor, bound to the specified parent.

Definition at line 50 of file qgsiodevicesensor.h.

◆ ~QgsIODeviceSensor()

QgsIODeviceSensor::~QgsIODeviceSensor ( )
override

Definition at line 26 of file qgsiodevicesensor.cpp.

Member Function Documentation

◆ initIODevice()

void QgsIODeviceSensor::initIODevice ( QIODevice *  device)
protected

Initiates the I/O device.

Note
Takes ownership of the device.

Definition at line 30 of file qgsiodevicesensor.cpp.

◆ iODevice()

QIODevice * QgsIODeviceSensor::iODevice ( ) const

Returns the I/O device.

Definition at line 40 of file qgsiodevicesensor.cpp.

◆ parseData

void QgsIODeviceSensor::parseData ( )
protectedvirtualslot

Parses the data read from the device when available.

Definition at line 45 of file qgsiodevicesensor.cpp.


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