このページでは

QOrientationReading Class

QOrientationReading クラスは、方位センサーからの1回の読み取り値を表します。詳細...

ヘッダー: #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.