The QTapReading class represents one reading from the tap sensor. More...
#include <QTapReading>
Inherits QSensorReading.
enum | TapDirection { Undefined, X, Y, Z, ..., Z_Neg } |
bool | isDoubleTap () const |
void | setDoubleTap ( bool doubleTap ) |
void | setTapDirection ( TapDirection tapDirection ) |
TapDirection | tapDirection () const |
The QTapReading class represents one reading from the tap sensor.
The tap sensor registers tap events in one of the six directions. There are 3 axes that originate from the phone. They are arranged as follows.
By default it returns only double tap events. The QTapSensor::returnDoubleTapEvents property must be set to false to return individual tap events.
The tap direction is reported as one of the six directions (X, Y, Z, positive and negative). There are 3 flags that you can use if you only care about the axis in use.
Constant | Value | Description |
---|---|---|
QTapReading::Undefined | 0 | This value means that the direction is unknown. |
QTapReading::X | 0x0001 | This flag is set if the tap was along the X axis. |
QTapReading::Y | 0x0002 | This flag is set if the tap was along the Y axis. |
QTapReading::Z | 0x0004 | This flag is set if the tap was along the Z axis. |
QTapReading::X_Pos | 0x0011 | This value is returned if the tap was towards the positive X direction. |
QTapReading::Y_Pos | 0x0022 | This value is returned if the tap was towards the positive Y direction. |
QTapReading::Z_Pos | 0x0044 | This value is returned if the tap was towards the positive Z direction. |
QTapReading::X_Neg | 0x0101 | This value is returned if the tap was towards the negative X direction. |
QTapReading::Y_Neg | 0x0202 | This value is returned if the tap was towards the negative Y direction. |
QTapReading::Z_Neg | 0x0404 | This value is returned if the tap was towards the negative Z direction. |
This property holds a value indicating if there was a single or double tap.
Access functions:
bool | isDoubleTap () const |
See also QTapReading Units.
This property holds the direction of the tap.
Access functions:
TapDirection | tapDirection () const |
See also QTapReading Units.
Sets the double tap status of the reading to doubleTap.
See also isDoubleTap().
Sets the tap direction to tapDirection.
See also tapDirection().