このページでは

QRotationSensor Class

QRotationSensor クラスは、QSensor をラップした便利なラッパーです。詳細...

ヘッダー: #include <QRotationSensor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
継承元: QSensor

プロパティ

パブリック関数

QRotationSensor(QObject *parent = nullptr)
virtual ~QRotationSensor()
bool hasZ() const
QRotationReading *reading() const
void setHasZ(bool hasZ)

シグナル

void hasZChanged(bool hasZ)

詳細な説明

動作上の唯一の違いは、このクラスが型を適切に設定する点です。

また、このクラスには、QSensorReading の代わりにQRotationReading を返すreading() 関数も備わっています。

センサーの動作の詳細については、QRotationReading を参照してください。

「QRotationReading」も参照してください 。

プロパティのドキュメント

[read-only] hasZ : bool

このプロパティは、z角が利用可能かどうかを示す値を保持します。

zが利用可能な場合はtrueを返します。zが利用できない場合はfalseを返します。

アクセス関数:

bool hasZ() const

通知シグナル:

void hasZChanged(bool hasZ)

メンバ関数のドキュメント

[explicit] QRotationSensor::QRotationSensor(QObject *parent = nullptr)

parent の子としてセンサーを構築します。

[virtual noexcept] QRotationSensor::~QRotationSensor()

センサーを破壊します。センサーがまだ停止していない場合は、停止させます。

QRotationReading *QRotationSensor::reading() const

このセンサーの読み取りクラスを返します。

QSensor::reading()も参照してください 。

void QRotationSensor::setHasZ(bool hasZ)

hasZ で z 軸の角度を利用可能にするかどうかを設定します。これはバックエンド側から呼び出す必要があります。デフォルトでは、hasZ プロパティは true になっているため、バックエンドは、自身の回転センサーが z 軸の角度を報告できない場合にのみ、これを呼び出す必要があります。

hasZ()も参照してください 。

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