QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
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.
 
 ~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
 

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: