Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QTapReading Class

The QTapReading class represents one reading from the tap sensor. More...

 #include <QTapReading>

Inherits: QSensorReading.

QTapReading is instantiated by QML element TapReading

Public Types

enum TapDirection { Undefined, X, Y, Z, ..., Z_Both }

Properties

Public Functions

bool isDoubleTap() const
void setDoubleTap(bool doubleTap)
void setTapDirection(TapDirection tapDirection)
TapDirection tapDirection() const

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 2 signal inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QTapReading class represents one reading from the tap sensor.

QTapReading Units

The tap sensor registers tap events along the 3 axes that originate from the phone. The axes 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.

Member Type Documentation

enum QTapReading::TapDirection

The tap direction is indicated using flags. Applications should check for the presence of a particular flag as multiple flags may be set at once.

The X, Y and Z flags allow an app to check for taps along an axis without caring about the direction.

 if (reading->tapDirection()&QTapReading::X) {
     ...
 }

The *_Pos and *_Neg flags allow checking for taps in a specific direction. Note that some devices cannot determine the direction of a tap and will set both the _Pos and _Neg flag for the detected axis. Previous versions of the API did not allow this. Applications that check for the _Pos and _Neg flags as values should be updated so they can work with all devices.

For example, if you have code like

 if (reading->tapDirection() == QTapReading::X_Pos) {
     ...
 }

you can rewrite it as

 if (reading->tapDirection()&QTapReading::X_Pos) {
     ...
 }
ConstantValueDescription
QTapReading::Undefined0This value means that the direction is unknown.
QTapReading::X0x0001This flag is set if the tap was along the X axis.
QTapReading::Y0x0002This flag is set if the tap was along the Y axis.
QTapReading::Z0x0004This flag is set if the tap was along the Z axis.
QTapReading::X_Pos0x0011This flag is set if the tap was towards the positive X direction.
QTapReading::Y_Pos0x0022This flag is set if the tap was towards the positive Y direction.
QTapReading::Z_Pos0x0044This flag is set if the tap was towards the positive Z direction.
QTapReading::X_Neg0x0101This flag is set if the tap was towards the negative X direction.
QTapReading::Y_Neg0x0202This flag is set if the tap was towards the negative Y direction.
QTapReading::Z_Neg0x0404This flag is set if the tap was towards the negative Z direction.
QTapReading::X_Both0x0111Equivalent to X_Pos|X_Neg. Returned by devices that cannot detect the direction of a tap.
QTapReading::Y_Both0x0222Equivalent to Y_Pos|Y_Neg. Returned by devices that cannot detect the direction of a tap.
QTapReading::Z_Both0x0444Equivalent to Z_Pos|Z_Neg. Returned by devices that cannot detect the direction of a tap.

Property Documentation

doubleTap : const bool

This property holds a value indicating if there was a single or double tap.

  • true - double tap
  • false - single tap

Access functions:

bool isDoubleTap() const

See also QTapReading Units.

tapDirection : const TapDirection

This property holds the direction of the tap.

Access functions:

TapDirection tapDirection() const

See also QTapReading Units.

Member Function Documentation

void QTapReading::setDoubleTap(bool doubleTap)

Sets the double tap status of the reading to doubleTap.

See also isDoubleTap().

void QTapReading::setTapDirection(TapDirection tapDirection)

Sets the tap direction to tapDirection.

See also tapDirection().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web