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  · 

TiltSensor

Provides access to the current X and Y axis rotation angles of the device. More...

Inherits Sensor

This type was introduced in QtSensors 5.0.

Properties

Signals

Methods

Detailed Description

This element provides tilt data from the rotation around the x and y axis of the device using the accelerometer sensor. Like for a marble and maze game, where the marble is rolled around the screen according to the user tilting the device.

This element is part of the QtSensors 5 module.

The Qt Sensors - Simple QML Example is an example how to use this QML element.

Property Documentation

accuracy : real

This property contains the accuracy (in degrees) in which the rotation should be measured. This can be used to minimize signal emiting and therefore saving of performance. Default value is 1 degree. The accuracy value is unsigned and works clockwise and counterclockwise in X and Y axis rotation directions. Accuracy range can be 0 to 90 degrees.

For example: Accuracy 5.5 will notify the client application about an rotation change only if the rotation angle over the X and / or Y axis was changed by 5.5 or more degrees clockwise or anti-clockwise.

Rotationnotify applicationreason
0.2424no
4.34234no
5.23423no
6.34324yesbecause 6.34324 >= 5.5
7.43264no
8.24504no
9.34653no
10.23476no
11.43565no
12.45645yesbecause 12.45645 - 6.34324 = 6.11321 >= 5.5

settings : real

This property contains the setting of the current state. It can be used for saving and reloading previously saved calibrations.


speed : enumeration

Holds the speed that the sensor should be run at. Default is Slow.

TiltSensor.SlowThe sensor runs in slow mode.Closest available datarate at 2Hz.
TiltSensor.MediumThe sensor runs in medium mode.Closest available datarate at 10Hz.
TiltSensor.FastThe sensor runs in fast mode.Closest available datarate at 20Hz.

Returns the unit of the rotation which can be one of:

TiltSensor.RadiansThe unit of the rotation angle is radians.
TiltSensor.DegreesThe unit of the rotation angle is degrees.

read-onlyxRotation : real

Holds the rotation arround the x axis.


read-onlyyRotation : real

Holds the rotation arround the y axis.


Signal Documentation

TiltSensor::tiltChanged(real deltaX, real deltaY)

This signal is emitted whenever the change from at leat one of the rotation values was higher than the accuracy. The angle value is based on the specified unit (Degree or Radian).

See also QtSensors5::TiltSensor::unit and TiltSensor.unit.


Method Documentation

void TiltSensor::calibrate()

The call of this function calibrates the tilt from x and y to the current position.


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