The QOrientationReading class represents one reading from the orientation sensor. More...
#include <QOrientationReading>
Inherits: QSensorReading.
This class was introduced in Qt Mobility 1.0.
enum | Orientation { Undefined, TopUp, TopDown, LeftUp, ..., FaceDown } |
Orientation | orientation () const |
void | setOrientation ( Orientation orientation ) |
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.
The orientation sensor returns the orientation of the device using the pre-defined values found in the QOrientationReading::Orientation enum.
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.
Constant | Value | Description |
---|---|---|
QOrientationReading::Undefined | 0 | The orientation is unknown. |
QOrientationReading::TopUp | 1 | The Top edge of the device is pointing up. |
QOrientationReading::TopDown | 2 | The Top edge of the device is pointing down. |
QOrientationReading::LeftUp | 3 | The Left edge of the device is pointing up. |
QOrientationReading::RightUp | 4 | The Right edge of the device is pointing up. |
QOrientationReading::FaceUp | 5 | The Face of the device is pointing up. |
QOrientationReading::FaceDown | 6 | The 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.
This property holds the orientation of the device.
The unit is an enumeration describing the orientation of the device.
This property was introduced in Qt Mobility 1.0.
Access functions:
Orientation | orientation () const |
See also QOrientationReading Units.
Sets the orientation for the reading.
This function was introduced in Qt Mobility 1.0.
See also orientation().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.