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  · 

QOrientationReading Class

The QOrientationReading class represents one reading from the orientation sensor. More...

 #include <QOrientationReading>

Inherits: QSensorReading.

QOrientationReading is instantiated by QML element OrientationReading

Public Types

enum Orientation { Undefined, TopUp, TopDown, LeftUp, ..., FaceDown }

Properties

Public Functions

Orientation orientation() const
void setOrientation(Orientation orientation)

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 QOrientationReading class represents one reading from the orientation sensor.

The orientation sensor reports the orientation of the device. As it operates below the UI level it does not report on or even know how the UI is rotated. Most importantly this means that this sensor cannot be used to detect if a device is in portrait or landscape mode.

This sensor is useful to detect that a particular side of the device is pointing up.

QOrientationReading Units

The orientation sensor returns the orientation of the device using the pre-defined values found in the QOrientationReading::Orientation enum.

Member Type Documentation

enum QOrientationReading::Orientation

This enum represents the orientation of the device.

To explain the meaning of each value it is helpful to refer to the following diagram.

The orientations are shown here in order: TopUp, TopDown, LeftUp, RightUp, FaceUp, FaceDown.

ConstantValueDescription
QOrientationReading::Undefined0The orientation is unknown.
QOrientationReading::TopUp1The Top edge of the device is pointing up.
QOrientationReading::TopDown2The Top edge of the device is pointing down.
QOrientationReading::LeftUp3The Left edge of the device is pointing up.
QOrientationReading::RightUp4The Right edge of the device is pointing up.
QOrientationReading::FaceUp5The Face of the device is pointing up.
QOrientationReading::FaceDown6The Face of the device is pointing down.

It should be noted that the orientation sensor reports the orientation of the device and not the UI. The orientation of the device will not change just because the UI is rotated. This means this sensor cannot be used to detect if a device is in portrait or landscape mode.

Property Documentation

orientation : const Orientation

This property holds the orientation of the device.

The unit is an enumeration describing the orientation of the device.

Access functions:

Orientation orientation() const

See also QOrientationReading Units.

Member Function Documentation

void QOrientationReading::setOrientation(Orientation orientation)

Sets the orientation for the reading.

See also orientation().

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