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::QGeoLocation(const QGeoLocation &other)

のコピーを作成する。other

[noexcept, 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

この場所を表示する際に推奨される表示領域を表す境界形状を返します。

例えば、建物の位置は建物を中心とした領域を持ちますが、その領域は周囲の地理的コンテキストを表示するのに十分な大きさです。

注意: このメソッドは Qt6 で boundingBox() メソッドの代わりに導入されました。このメソッドは、QGeoRectangle の代わりにQGeoShape を返します。QGeoShape::boundingGeoRectangle() を使用して、図形の境界線QGeoRectangle を取得します。

この関数は 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)

move-assingsother をこの場所に移動し、この場所への参照を返す。

注意: 移動元の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 を返す。

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