Skip to content

Class SensorListModel

ClassList > SensorListModel

Inherits the following classes: QSortFilterProxyModel

Public Properties

Type Name
property QgsProject * project
property bool showConnectedOnly

Public Signals

Type Name
signal void projectChanged
Emitted when the current project has changed.
signal void sensorErrorOccurred (const QString & errorString)
Emitted when a sensor error has occurred. An errorString provides details on the error.
signal void showConnectedOnlyChanged
Emitted when the show connected only filter has changed.

Public Functions

Type Name
SensorListModel (QObject * parent=nullptr)
Q_INVOKABLE void connectSensorId (const QString & id) const
Q_INVOKABLE void disconnectSensorId (const QString & id) const
QgsProject * project () const
Returns the current project from which sensors are retrieved.
QHash< int, QByteArray > roleNames () override const
void setProject (QgsProject * project)
Sets the project to be used to retrieve sensors.
void setShowConnectedOnly (bool showConnectedOnly)
Sets whether the model should only show connected sensors.
bool showConnectedOnly () const
Returns TRUE when the model only shows connected sensors.

Protected Functions

Type Name
bool filterAcceptsRow (int source_row, const QModelIndex & source_parent) override const

Public Properties Documentation

property project [1/2]

QgsProject * SensorListModel::project;

property showConnectedOnly [1/2]

bool SensorListModel::showConnectedOnly;

Public Signals Documentation

signal projectChanged

Emitted when the current project has changed.

void SensorListModel::projectChanged;

signal sensorErrorOccurred

Emitted when a sensor error has occurred. An errorString provides details on the error.

void SensorListModel::sensorErrorOccurred;

signal showConnectedOnlyChanged

Emitted when the show connected only filter has changed.

void SensorListModel::showConnectedOnlyChanged;

Public Functions Documentation

function SensorListModel

explicit SensorListModel::SensorListModel (
    QObject * parent=nullptr
) 

function connectSensorId

Q_INVOKABLE void SensorListModel::connectSensorId (
    const QString & id
) const

Connects a sensor.

Parameters:

  • id The unique ID string of the sensor

function disconnectSensorId

Q_INVOKABLE void SensorListModel::disconnectSensorId (
    const QString & id
) const

Disconnects a sensor.

Parameters:

  • id The unique ID string of the sensor

function project [2/2]

Returns the current project from which sensors are retrieved.

QgsProject * SensorListModel::project () const

function roleNames

QHash< int, QByteArray > SensorListModel::roleNames () override const

function setProject

Sets the project to be used to retrieve sensors.

void SensorListModel::setProject (
    QgsProject * project
) 

function setShowConnectedOnly

Sets whether the model should only show connected sensors.

void SensorListModel::setShowConnectedOnly (
    bool showConnectedOnly
) 

function showConnectedOnly [2/2]

Returns TRUE when the model only shows connected sensors.

inline bool SensorListModel::showConnectedOnly () const

Protected Functions Documentation

function filterAcceptsRow

bool SensorListModel::filterAcceptsRow (
    int source_row,
    const QModelIndex & source_parent
) override const


The documentation for this class was generated from the following file src/core/sensorlistmodel.h