QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Types | Public Member Functions | List of all members
QgsSensorModel Class Reference

A QAbstractItemModel subclass for showing sensors within a QgsSensorManager. More...

#include <qgssensormodel.h>

Inheritance diagram for QgsSensorModel:
Inheritance graph
[legend]

Public Types

enum class  Column : int { Name = 0 , LastValue = 1 }
 Model columns. More...
 
enum class  CustomRole : int {
  SensorType = Qt::UserRole + 1 , SensorId , SensorName , SensorStatus ,
  SensorLastValue , SensorLastTimestamp , Sensor
}
 Custom model roles. More...
 

Public Member Functions

 QgsSensorModel (QgsSensorManager *manager, QObject *parent=nullptr)
 Constructor for QgsSensorModel, for the specified manager and parent object. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 

Detailed Description

A QAbstractItemModel subclass for showing sensors within a QgsSensorManager.

Since
QGIS 3.32

Definition at line 32 of file qgssensormodel.h.

Member Enumeration Documentation

◆ Column

enum class QgsSensorModel::Column : int
strong

Model columns.

Enumerator
Name 

Name.

LastValue 

Last value.

Definition at line 39 of file qgssensormodel.h.

◆ CustomRole

enum class QgsSensorModel::CustomRole : int
strong

Custom model roles.

Note
Prior to QGIS 3.36 this was available as QgsSensorModel::Role
Since
QGIS 3.36
Enumerator
SensorType 

Sensor type.

SensorId 

Sensor id.

SensorName 

Sensor name.

SensorStatus 

Sensor status (disconnected, connected, etc.)

SensorLastValue 

Sensor last captured value.

SensorLastTimestamp 

Sensor timestamp of last captured value.

Sensor 

Sensor object pointer.

Definition at line 53 of file qgssensormodel.h.

Constructor & Destructor Documentation

◆ QgsSensorModel()

QgsSensorModel::QgsSensorModel ( QgsSensorManager manager,
QObject *  parent = nullptr 
)
explicit

Constructor for QgsSensorModel, for the specified manager and parent object.

Definition at line 23 of file qgssensormodel.cpp.

Member Function Documentation

◆ columnCount()

int QgsSensorModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 225 of file qgssensormodel.cpp.

◆ data()

QVariant QgsSensorModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 46 of file qgssensormodel.cpp.

◆ flags()

Qt::ItemFlags QgsSensorModel::flags ( const QModelIndex &  index) const
override

Definition at line 155 of file qgssensormodel.cpp.

◆ headerData()

QVariant QgsSensorModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Definition at line 169 of file qgssensormodel.cpp.

◆ index()

QModelIndex QgsSensorModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 198 of file qgssensormodel.cpp.

◆ parent()

QModelIndex QgsSensorModel::parent ( const QModelIndex &  index) const
override

Definition at line 211 of file qgssensormodel.cpp.

◆ rowCount()

int QgsSensorModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 216 of file qgssensormodel.cpp.

◆ setData()

bool QgsSensorModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Definition at line 131 of file qgssensormodel.cpp.


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