このページでは

QCompassReading Class

QCompassReading クラスは、コンパスからの 1 回の測定値を表します。詳細...

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

プロパティ

公開関数

qreal azimuth() const
qreal calibrationLevel() const
void setAzimuth(qreal azimuth)
void setCalibrationLevel(qreal calibrationLevel)

詳細な説明

QCompassReading 単位

コンパスは、QScreen::nativeOrientation で定義されているように、デバイスの上面を基準として、磁北からの方位角を時計回りの度数で返します。また、デバイスのキャリブレーション状態を示す値もあります。デバイスがキャリブレーションされていない場合、方位角は正確でない可能性があります。

デジタルコンパスは磁気干渉を受けやすいため、磁力を発生させる物の近くに置いた後は、キャリブレーションが必要になる場合があります。コンパスの精度は、近くにある鉄系物質の影響を受ける可能性があります。

デバイスのキャリブレーション状態は、0 から 1 までの数値で表されます。値 1 はデバイスがサポートできる最高レベルであり、0 は最低レベルです。

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

[read-only] azimuth : qreal

このプロパティには、デバイスの方位角が格納されます。

QScreen::nativeOrientation で定義されているように、デバイスの上部を基準として、磁北から時計回りに度単位で測定されます。

アクセス関数:

qreal azimuth() const

QCompassReading Unitsも参照してください 。

[read-only] calibrationLevel : qreal

このプロパティには、測定値の校正レベルが格納されています。

0 から 1 までの値で測定され、値が大きいほど良好です。

アクセス機能:

qreal calibrationLevel() const

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

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

void QCompassReading::setAzimuth(qreal azimuth)

デバイスのazimuth を設定します。

azimuth() およびQCompassReading Unitsも参照してください 。

void QCompassReading::setCalibrationLevel(qreal calibrationLevel)

読み取り値のキャリブレーションレベルを「calibrationLevel 」に設定します。

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

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