Class: QgsSensorModel

class qgis.core.QgsSensorModel

Bases: PyQt5.QtCore.QAbstractItemModel

A QAbstractItemModel subclass for showing sensors within a QgsSensorManager.

New in version 3.32.

QgsSensorModel(manager: QgsSensorManager, parent: QObject = None) Constructor for QgsSensorModel, for the specified manager and parent object.

Enums

Column

Bases: enum.IntEnum

Methods

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

columnCount

param parent:

connectNotify

createIndex

customEvent

data

param index:

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

flags

param index:

headerData

param section:

index

param row:

isSignalConnected

parent

param index:

persistentIndexList

receivers

resetInternalData

rowCount

param parent:

sender

senderSignalIndex

setData

param index:

timerEvent

Attributes

Sensor

SensorId

SensorLastTimestamp

SensorLastValue

SensorName

SensorStatus

SensorType

class Column(value)

Bases: enum.IntEnum

Model columns

  • Name: Name

  • LastValue: Last value

LastValue = 1
Name = 0
class Role

Bases: int

Sensor = 263
SensorId = 258
SensorLastTimestamp = 262
SensorLastValue = 261
SensorName = 259
SensorStatus = 260
SensorType = 257
QgsSensorModel.beginInsertColumns(self, QModelIndex, int, int)
QgsSensorModel.beginInsertRows(self, QModelIndex, int, int)
QgsSensorModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsSensorModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsSensorModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsSensorModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsSensorModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
columnCount(self, parent: QModelIndex = QModelIndex()) int
Parameters:

parent (QModelIndex = QModelIndex()) –

Return type:

int

connectNotify(self, QMetaMethod)
QgsSensorModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
customEvent(self, QEvent)
data(self, index: QModelIndex, role: int) Any
Parameters:
  • index (QModelIndex) –

  • role (int) –

Return type:

Any

QgsSensorModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
disconnectNotify(self, QMetaMethod)
encodeData(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
flags(self, index: QModelIndex) Qt.ItemFlags
Parameters:

index (QModelIndex) –

Return type:

Qt.ItemFlags

headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) Any
Parameters:
  • section (int) –

  • orientation (Qt.Orientation) –

  • role (int = Qt.DisplayRole) –

Return type:

Any

index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) QModelIndex
Parameters:
  • row (int) –

  • column (int) –

  • parent (QModelIndex = QModelIndex()) –

Return type:

QModelIndex

isSignalConnected(self, QMetaMethod) bool
parent(self, index: QModelIndex) QModelIndex
Parameters:

index (QModelIndex) –

Return type:

QModelIndex

persistentIndexList(self) List[QModelIndex]
receivers(self, PYQT_SIGNAL) int
resetInternalData(self)
rowCount(self, parent: QModelIndex = QModelIndex()) int
Parameters:

parent (QModelIndex = QModelIndex()) –

Return type:

int

sender(self) QObject
senderSignalIndex(self) int
setData(self, index: QModelIndex, value: Any, role: int = Qt.EditRole) bool
Parameters:
  • index (QModelIndex) –

  • value (Any) –

  • role (int = Qt.EditRole) –

Return type:

bool

timerEvent(self, QTimerEvent)