QSensorGesture Class

The QSensorGesture class represents one or more sensor gesture recognizers. 更多...

头文件: #include <QSensorGesture>
qmake: QT += sensors
开始支持版本: Qt 5.1
基类: QObject

公有函数

QSensorGesture(const QStringList &ids, QObject *parent = Q_NULLPTR)
~QSensorGesture()
QStringList gestureSignals() const
QStringList invalidIds() const
bool isActive()
void startDetection()
void stopDetection()
QStringList validIds() const
  • 32 个公有函数继承自 QObject

信号

void detected(QString gestureId)

其他继承的成员

  • 1 个属性继承自 QObject
  • 1 个公有槽函数继承自 QObject
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

The QSensorGesture class represents one or more sensor gesture recognizers.

In addition to the QSensorGesture::detected() signal, Sensor Gesture Recognizers can have their own specific signals, and may be discovered through QSensorGesture::gestureSignals().

Note that QSensorGesture uses a custom meta-object in order to provide recognizer-specific signals. This means it is not possible to sub-class QSensorGesture and use Q_OBJECT. Also qobject_cast<QSensorGesture*>(ptr) will not work.

You may use QSensorGestureManager to obtain the systems known sensor gesture ids.

参见 QSensorGestureRecognizer and QSensorGestureManager.

成员函数

QSensorGesture::QSensorGesture(const QStringList &ids, QObject *parent = Q_NULLPTR)

Constructs the sensor gesture, and initializes the ids list of recognizers, with parent parent

QSensorGesture::~QSensorGesture()

Destroy the QSensorGesture

[signal] void QSensorGesture::detected(QString gestureId)

Signals when the gestureId gesture has been recognized.

QStringList QSensorGesture::gestureSignals() const

Returns all the possible gestures signals that may be emitted.

QStringList QSensorGesture::invalidIds() const

Returns the gesture recognizer ids that were not found.

bool QSensorGesture::isActive()

Returns whether this gesture is active or not.

void QSensorGesture::startDetection()

Starts the gesture detection routines in the recognizer.

void QSensorGesture::stopDetection()

Stops the gesture detection routines.

QStringList QSensorGesture::validIds() const

Returns the gesture recognizer ids that were found.