Class: QgsSensorModel¶
- class qgis.core.QgsSensorModel¶
Bases:
PyQt5.QtCore.QAbstractItemModel
A QAbstractItemModel subclass for showing sensors within a
QgsSensorManager
.Added in version 3.32.
QgsSensorModel(manager: Optional[QgsSensorManager], parent: Optional[QObject] = None) Constructor for
QgsSensorModel
, for the specifiedmanager
andparent
object.Enums
Bases:
enum.IntEnum
Bases:
enum.IntEnum
alias of
CustomRole
Methods
- param parent:
- param index:
- param index:
- param section:
- param row:
- param index:
- param parent:
- param index:
- class Column(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.IntEnum
Model columns
Name
: NameLastValue
: Last value
- LastValue = 1¶
- Name = 0¶
- class CustomRole(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsSensorModel.Role
Added in version 3.36.
SensorType
: Sensor typeSensorId
: Sensor idSensorName
: Sensor nameSensorStatus
: Sensor status (disconnected, connected, etc.)SensorLastValue
: Sensor last captured valueSensorLastTimestamp
: Sensor timestamp of last captured valueSensor
: Sensor object pointer
- baseClass¶
alias of
QgsSensorModel
- Role¶
alias of
CustomRole
- beginInsertColumns(self, parent: QModelIndex, first: int, last: int)¶
- beginInsertRows(self, parent: QModelIndex, first: int, last: int)¶
- beginMoveColumns(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationColumn: int) bool ¶
- beginMoveRows(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationRow: int) bool ¶
- beginRemoveColumns(self, parent: QModelIndex, first: int, last: int)¶
- beginRemoveRows(self, parent: QModelIndex, first: int, last: int)¶
- beginResetModel(self)¶
- changePersistentIndex(self, from_: QModelIndex, to: QModelIndex)¶
- changePersistentIndexList(self, from_: Iterable[QModelIndex], to: Iterable[QModelIndex])¶
- childEvent(self, a0: QChildEvent | None)¶
- columnCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters:
parent (QModelIndex = QModelIndex())
- Return type:
int
- connectNotify(self, signal: QMetaMethod)¶
- createIndex(self, row: int, column: int, object: Any = None) QModelIndex ¶
- customEvent(self, a0: QEvent | None)¶
- data(self, index: QModelIndex, role: int) Any ¶
- Parameters:
index (QModelIndex)
role (int)
- Return type:
Any
- decodeData(self, row: int, column: int, parent: QModelIndex, stream: QDataStream) bool ¶
- disconnectNotify(self, signal: QMetaMethod)¶
- encodeData(self, indexes: Iterable[QModelIndex], stream: 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, signal: QMetaMethod) bool ¶
- parent(self, index: QModelIndex) QModelIndex ¶
- Parameters:
index (QModelIndex)
- Return type:
QModelIndex
- persistentIndexList(self) List[QModelIndex] ¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters:
parent (QModelIndex = QModelIndex())
- Return type:
int
- sender(self) QObject | None ¶
- 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, a0: QTimerEvent | None)¶