이 페이지에서

QOrientationReading Class

QOrientationReading 클래스는 방향 센서의 단일 측정값을 나타냅니다. 더 보기...

헤더: #include <QOrientationReading>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
상속: QSensorReading

공개 타입

enum Orientation { Undefined, TopUp, TopDown, LeftUp, RightUp, …, FaceDown }

속성

공개 함수

QOrientationReading::Orientation orientation() const
void setOrientation(QOrientationReading::Orientation orientation)

상세 설명

방향 센서는 기기의 방향을 보고합니다. 이 센서는 UI 수준 아래에서 작동하므로 UI가 어떻게 회전되었는지에 대해서는 보고하지 않으며, 심지어 이를 인식하지도 못합니다. 가장 중요한 점은, 이 센서를 사용하여 기기가 세로 모드인지 가로 모드인지 감지할 수 없다는 것입니다.

이 센서는 기기의 특정 면이 위를 향하고 있는지 감지하는 데 유용합니다.

QOrientationReading 단위

방향 센서는 ` QOrientationReading::Orientation ` 열거형에 정의된 값을 사용하여 기기의 방향을 반환합니다.

멤버 유형 설명서

enum QOrientationReading::Orientation

이 열거형은 기기의 방향을 나타냅니다.

각 값의 의미를 설명하기 위해서는 다음 다이어그램을 참고하는 것이 도움이 됩니다.

상단, 왼쪽, 오른쪽 및 전면 가장자리가 표시된 장치

여기에는 TopUp, TopDown, LeftUp, RightUp, FaceUp, FaceDown 순서로 방향이 표시되어 있습니다.

TopUp, TopDown, LeftUp, RightUp, FaceUp 및 FaceDown 방향으로 표시된 장치

상수값설명
QOrientationReading::Undefined0방향은 알 수 없습니다.
QOrientationReading::TopUp1기기의 상단 가장자리가 위쪽을 향하고 있습니다.
QOrientationReading::TopDown2기기의 상단 가장자리가 아래를 향하고 있습니다.
QOrientationReading::LeftUp3기기의 왼쪽 가장자리가 위를 향하고 있습니다.
QOrientationReading::RightUp4기기의 오른쪽 가장자리가 위를 향하고 있습니다.
QOrientationReading::FaceUp5기기의 전면이 위를 향하고 있습니다.
QOrientationReading::FaceDown6기기의 전면이 아래를 향하고 있습니다.

방향 센서는 UI가 아닌 기기의 방향을 감지한다는 점에 유의해야 합니다. UI가 회전된다고 해서 기기의 방향이 바뀌지는 않습니다. 즉, 이 센서를 사용하여 기기가 세로 모드인지 가로 모드인지 감지할 수는 없습니다.

속성 설명서

[read-only] orientation : Orientation

이 속성은 장치의 방향을 나타냅니다.

단위는 기기의 방향을 설명하는 열거형입니다.

액세스 함수:

QOrientationReading::Orientation orientation() const

QOrientationReading Units도 참조하십시오 .

멤버 함수 설명서

void QOrientationReading::setOrientation(QOrientationReading::Orientation orientation)

읽기 작업에 대한 orientation 을 설정합니다.

orientation()도 참조하십시오 .

© 2026 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.