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 ユニット

Orientationセンサーは、QOrientationReading::Orientation enumにある定義済みの値を使用してデバイスの向きを返します。

メンバ型ドキュメント

enum QOrientationReading::Orientation

この列挙型はデバイスの向きを表す。

各値の意味を説明するために、以下の図を参照するとよい。

ここでは向きを順に示す: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 : const Orientation

このプロパティは、デバイスの向きを保持する。

単位は、デバイスの向きを表す列挙である。

アクセス関数:

QOrientationReading::Orientation orientation() const

QOrientationReading Unitsも参照

メンバ関数ドキュメント

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

orientation を設定する。

orientation()も参照のこと

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