QGeoLocation Class
QGeoLocation クラスは、位置に関する基本情報を表します。詳細...
| ヘッダー: | #include <QGeoLocation> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Positioning) target_link_libraries(mytarget PRIVATE Qt6::Positioning) |
| qmake: | QT += positioning |
パブリック関数
| QGeoLocation() | |
| QGeoLocation(const QGeoLocation &other) | |
(since 6.2) | QGeoLocation(QGeoLocation &&other) |
| ~QGeoLocation() | |
| QGeoAddress | address() const |
(since 6.2) QGeoShape | boundingShape() const |
| QGeoCoordinate | coordinate() const |
| QVariantMap | extendedAttributes() const |
| bool | isEmpty() const |
| void | setAddress(const QGeoAddress &address) |
(since 6.2) void | setBoundingShape(const QGeoShape &boundingShape) |
| void | setCoordinate(const QGeoCoordinate &coordinate) |
| void | setExtendedAttributes(const QVariantMap &data) |
(since 6.2) void | swap(QGeoLocation &other) |
(since 6.2) QGeoLocation & | operator=(QGeoLocation &&other) |
| QGeoLocation & | operator=(const QGeoLocation &other) |
関連する非メンバー
| size_t | qHash(const QGeoLocation &location, size_t seed = 0) |
| bool | operator!=(const QGeoLocation &lhs, const QGeoLocation &rhs) |
| bool | operator==(const QGeoLocation &lhs, const QGeoLocation &rhs) |
メンバ関数のドキュメント
QGeoLocation::QGeoLocation()
新しいロケーションオブジェクトを作成します。
QGeoLocation::QGeoLocation(const QGeoLocation &other)
のコピーを作成しますother
[constexpr noexcept default, since 6.2] QGeoLocation::QGeoLocation(QGeoLocation &&other)
other から移動して、地理位置情報オブジェクトを生成します。
注: 移動元の QGeoLocationオブジェクトに対しては 、破棄または代入のみが可能です。デストラクタや代入演算子以外の関数を呼び出した場合、その挙動は未定義となります。
この関数は Qt 6.2 で導入されました。
[noexcept] QGeoLocation::~QGeoLocation()
ロケーションオブジェクトを破棄します。
QGeoAddress QGeoLocation::address() const
その場所のアドレスを返します。
setAddress()も参照してください 。
[since 6.2] QGeoShape QGeoLocation::boundingShape() const
この位置を表示する際に推奨される領域を表すバウンディングシェイプを返します。
たとえば、建物の位置には、その建物を中心とする領域が含まれる場合がありますが、その領域は、建物のすぐ周囲の地理的背景を表示できるほど十分に広くなっています。
注:この メソッドは 、boundingBox() メソッドに代わって Qt6 で導入されました。QGeoRectangle ではなく、QGeoShape を返します。シェイプの境界QGeoRectangle を取得するには、QGeoShape::boundingGeoRectangle() を使用してください。
この関数は Qt 6.2 で導入されました。
setBoundingShape()も参照してください 。
QGeoCoordinate QGeoLocation::coordinate() const
その位置の座標を返します。
setCoordinate()も参照してください 。
QVariantMap QGeoLocation::extendedAttributes() const
このロケーションに関連付けられた拡張属性を返します。拡張属性はバックエンドに依存し、ロケーションに依存する場合もあります。
setExtendedAttributes()も参照してください 。
bool QGeoLocation::isEmpty() const
位置座標が `invalid` で、他のすべての位置フィールドが空の場合、true を返します。それ以外の場合は、false を返します。
void QGeoLocation::setAddress(const QGeoAddress &address)
その場所のaddress を設定します。
address()も参照してください 。
[since 6.2] void QGeoLocation::setBoundingShape(const QGeoShape &boundingShape)
そのロケーションのboundingShape を設定します。
この関数は Qt 6.2 で導入されました。
boundingShape()も参照してください 。
void QGeoLocation::setCoordinate(const QGeoCoordinate &coordinate)
その場所のcoordinate を設定します。
coordinate()も参照してください 。
void QGeoLocation::setExtendedAttributes(const QVariantMap &data)
data で指定されたパラメータを使用して、その場所の拡張属性を設定します。
extendedAttributes()も参照してください 。
[noexcept, since 6.2] void QGeoLocation::swap(QGeoLocation &other)
この位置をother と入れ替えます。この操作は非常に高速で、失敗することはありません。
この関数は Qt 6.2 で導入されました。
[noexcept, since 6.2] QGeoLocation &QGeoLocation::operator=(QGeoLocation &&other)
other をこの場所に移動し、この場所への参照を返します。
注: 移動元の `QGeoLocation `オブジェクトに対しては 、破棄または代入のみを行うことができます。デストラクタまたは代入演算子のいずれか以外の関数を呼び出した場合、その動作は未定義となります。
この関数は Qt 6.2 で導入されました。
QGeoLocation &QGeoLocation::operator=(const QGeoLocation &other)
このロケーションにother を割り当て、このロケーションへの参照を返します。
関連する非メンバー
[noexcept] size_t qHash(const QGeoLocation &location, size_t seed = 0)
location のハッシュ値を、seed を用いて計算し、その結果を返します。
注:この ハッシュ値の計算では 、拡張属性は考慮されません。つまり、拡張属性のみが異なる2つの地理位置情報オブジェクトでも、類似したハッシュ値が得られます。
bool operator!=(const QGeoLocation &lhs, const QGeoLocation &rhs)
lhs の場所がrhs と一致しない場合はtrue を返し、一致する場合はfalse を返します。
bool operator==(const QGeoLocation &lhs, const QGeoLocation &rhs)
lhs の場所がrhs と一致する場合は `true ` を返し、そうでない場合は `false` を返します。
© 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.