QSensorGestureManager Class

The QSensorGestureManager class manages sensor gestures, registers and creates sensor gesture plugins. 更多...

头: #include <QSensorGestureManager>
qmake: QT += sensors
Since: Qt 5.1
继承: QObject

公共函数

QSensorGestureManager (QObject * parent = Q_NULLPTR)
~QSensorGestureManager ()
QStringList gestureIds () const
QStringList recognizerSignals (const QString & gestureId ) const
bool registerSensorGestureRecognizer (QSensorGestureRecognizer * recognizer )

信号

void newSensorGestureAvailable ()

静态公共成员

QSensorGestureRecognizer * sensorGestureRecognizer (const QString & id )

额外继承成员

详细描述

The QSensorGestureManager class manages sensor gestures, registers and creates sensor gesture plugins.

Sensor Gesture plugins register their recognizers using the registerSensorGestureRecognizer () 函数。


  // Create a QSensorGestureManager
      QSensorGestureManager gestureManager;
  // Get a list of known recognizers
      QStringList recognizersList = gestureManager.gestureIds();
  // Create a QSensorGeture object for each of those gesture recognizers
          QSensorGesture *gesture = new QSensorGesture( gestureManager.gestureIds(), this);
  // Connect the known signals up.
          connect(gesture, SIGNAL(detected(QString)), this, SLOT(gestureDetected(QString)));
					

成员函数文档编制

QSensorGestureManager:: QSensorGestureManager ( QObject * parent = Q_NULLPTR)

构造 QSensorGestureManager 作为子级对于 parent

QSensorGestureManager:: ~QSensorGestureManager ()

Destroy the QSensorGestureManager

QStringList QSensorGestureManager:: gestureIds () const

Returns the list of the currently registered gestures. Includes all the standard built-ins as well as available plugins.

[signal] void QSensorGestureManager:: newSensorGestureAvailable ()

Signals when a new sensor gesture becomes available for use.

QStringList QSensorGestureManager:: recognizerSignals (const QString & gestureId ) const

Returns the list of all the gesture signals for the registered gestureId gesture recognizer id.

bool QSensorGestureManager:: registerSensorGestureRecognizer ( QSensorGestureRecognizer * recognizer )

Registers the sensor recognizer recognizer for use. QSensorGestureManager retains ownership of the recognizer object. Returns true unless the gesture has already been registered, in which case the object is deleted.

[static] QSensorGestureRecognizer *QSensorGestureManager:: sensorGestureRecognizer (const QString & id )

Returns the sensor gesture object for the recognizer id .