QOrientationReading#
The QOrientationReading
class represents one reading from the orientation sensor. More…
Synopsis#
Properties#
orientation
- The orientation of the device
Functions#
def
orientation
()def
setOrientation
(orientation)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
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 Orientation
enum.
- class PySide6.QtSensors.QOrientationReading(parent)#
- Parameters:
parent –
PySide6.QtCore.QObject
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtSensors.QOrientationReading.orientation: Orientation#
This property holds the orientation of the device..
The unit is an enumeration describing the orientation of the device.
See also
QOrientationReading Units
- Access functions:
orientation
()
- PySide6.QtSensors.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.
Constant
Description
QOrientationReading.Undefined
The orientation is unknown.
QOrientationReading.TopUp
The Top edge of the device is pointing up.
QOrientationReading.TopDown
The Top edge of the device is pointing down.
QOrientationReading.LeftUp
The Left edge of the device is pointing up.
QOrientationReading.RightUp
The Right edge of the device is pointing up.
QOrientationReading.FaceUp
The Face of the device is pointing up.
QOrientationReading.FaceDown
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.
- PySide6.QtSensors.QOrientationReading.orientation()#
- Return type:
See also
Getter of property orientation
.
- PySide6.QtSensors.QOrientationReading.setOrientation(orientation)#
- Parameters:
orientation –
Orientation
Sets the orientation
for the reading.
See also