内容表

上一话题

QOrientationFilter

下一话题

QOrientationSensor

QOrientationReading

QOrientationReading class represents one reading from the orientation sensor. 更多

Inheritance diagram of PySide2.QtSensors.QOrientationReading

概要

函数

详细描述

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 取向 枚举。

class QOrientationReading ( parent )
参数

parent QObject

PySide2.QtSensors.QOrientationReading. 取向

This enum represents the orientation of the device.

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

../../_images/sensors-sides.jpg

The orientations are shown here in order: , , , , , .

../../_images/sensors-orientation.jpg

常量

描述

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.

PySide2.QtSensors.QOrientationReading. orientation ( )
返回类型

取向

另请参阅

setOrientation()

PySide2.QtSensors.QOrientationReading. setOrientation ( orientation )
参数

orientation 取向

设置 orientation for the reading.

另请参阅

orientation()