内容表

上一话题

QSensorGestureRecognizer

下一话题

QSensorPluginInterface

QSensorManager

QSensorManager class handles registration and creation of sensor backends. 更多

Inheritance diagram of PySide2.QtSensors.QSensorManager

概要

静态函数

详细描述

Sensor plugins register backends using the registerBackend() 函数。

connectToBackend() is called, the createBackend() function will be called.

class QSensorManager
static PySide2.QtSensors.QSensorManager. createBackend ( sensor )
参数

sensor QSensor

返回类型

QSensorBackend

Create a backend for sensor . Returns null if no suitable backend exists.

static PySide2.QtSensors.QSensorManager. isBackendRegistered ( type , identifier )
参数
  • type QByteArray

  • identifier QByteArray

返回类型

bool

Returns true if the backend identified by type and identifier is registered.

This is a convenience method that helps out plugins doing dynamic registration.

static PySide2.QtSensors.QSensorManager. registerBackend ( type , identifier , factory )
参数

Register a sensor for type identifier must be unique.

factory will be asked to create instances of the backend.

static PySide2.QtSensors.QSensorManager. setDefaultBackend ( type , identifier )
参数
  • type QByteArray

  • identifier QByteArray

Sets or overwrite the sensor type with the backend identifier .

static PySide2.QtSensors.QSensorManager. unregisterBackend ( type , identifier )
参数
  • type QByteArray

  • identifier QByteArray

Unregister the backend for type with identifier .

Note that this only prevents new instance of the backend from being created. It does not invalidate the existing instances of the backend. The backend code should handle the disappearance of the underlying hardware itself.