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
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: , , , , , .
The orientation is unknown.
The Top edge of the device is pointing up.
The Top edge of the device is pointing down.
The Left edge of the device is pointing up.
The Right edge of the device is pointing up.
The Face of the device is pointing up.
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.
- Return type
orientation for the reading.
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.