QGeoRectangle Class
QGeoRectangle クラスは、長方形の地理的領域を定義します。詳細...
| ヘッダー: | #include <QGeoRectangle> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Positioning) target_link_libraries(mytarget PRIVATE Qt6::Positioning) |
| qmake: | QT += positioning |
| 継承元: | QGeoShape |
プロパティ
|
公開関数
| QGeoRectangle() | |
| QGeoRectangle(const QGeoShape &other) | |
| QGeoRectangle(const QList<QGeoCoordinate> &coordinates) | |
| QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight) | |
| QGeoRectangle(const QGeoCoordinate ¢er, double degreesWidth, double degreesHeight) | |
| QGeoRectangle(const QGeoRectangle &other) | |
| ~QGeoRectangle() | |
| QGeoCoordinate | bottomLeft() const |
| QGeoCoordinate | bottomRight() const |
| QGeoCoordinate | center() const |
| bool | contains(const QGeoRectangle &rectangle) const |
| void | extendRectangle(const QGeoCoordinate &coordinate) |
| double | height() const |
| bool | intersects(const QGeoRectangle &rectangle) const |
| void | setBottomLeft(const QGeoCoordinate &bottomLeft) |
| void | setBottomRight(const QGeoCoordinate &bottomRight) |
| void | setCenter(const QGeoCoordinate ¢er) |
| void | setHeight(double degreesHeight) |
| void | setTopLeft(const QGeoCoordinate &topLeft) |
| void | setTopRight(const QGeoCoordinate &topRight) |
| void | setWidth(double degreesWidth) |
| QString | toString() const |
| QGeoCoordinate | topLeft() const |
| QGeoCoordinate | topRight() const |
| void | translate(double degreesLatitude, double degreesLongitude) |
| QGeoRectangle | translated(double degreesLatitude, double degreesLongitude) const |
| QGeoRectangle | united(const QGeoRectangle &rectangle) const |
| double | width() const |
| QGeoRectangle & | operator=(const QGeoRectangle &other) |
| QGeoRectangle | operator|(const QGeoRectangle &rectangle) const |
| QGeoRectangle & | operator|=(const QGeoRectangle &rectangle) |
詳細な説明
矩形は、矩形の左上の座標を指定する `QGeoCoordinate ` と、矩形の右下の座標を指定する `QGeoCoordinate ` によって定義されます。
左上座標または右下座標が無効である場合、あるいは左上座標が右下座標の南側にある場合、そのジオ矩形は無効とみなされます。
Geo 矩形は極点を通ることはできません。
いくつかのメソッドは、GeoRectangle が中心座標、GeoRectangle の幅(度単位)、および GeoRectangle の高さ(度単位)によって定義されているかのように動作します。
ジオ矩形の高さまたは中心が調整され、その結果、極のいずれかにまたがるようになった場合、ジオ矩形が極に接触はするがまたがらないように高さが変更され、中心座標が引き続きジオ矩形の中心にあるように調整されます。
このクラスは、QML でも `geoRectangle` としてアクセス可能です。
プロパティのドキュメント
bottomLeft : QGeoCoordinate
このプロパティは、このジオレクタングルの左下座標を保持します。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
| QGeoCoordinate | bottomLeft() const |
| void | setBottomLeft(const QGeoCoordinate &bottomLeft) |
bottomRight : QGeoCoordinate
このプロパティは、このジオ矩形の右下座標を保持します。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
| QGeoCoordinate | bottomRight() const |
| void | setBottomRight(const QGeoCoordinate &bottomRight) |
center : QGeoCoordinate
このプロパティは、このジオ矩形の中心を保持します。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
QGeoShape::centerも参照してください 。
height : double
このプロパティには、このジオ矩形の高さが度単位で格納されます。
このジオレクタングルが無効な場合、プロパティの値は未定義となります。
新しい高さが 0.0 未満の場合、またはこのジオ矩形が無効な場合、このプロパティは変更されません。中心、幅、高さに基づいて無効なジオ矩形の値を設定するには、まず `setCenter()` を使用してジオ矩形を有効にする必要があります。
高さの変更によってジオ矩形が極を横切ることになる場合、ジオ矩形が極に接触するのみとなるよう高さが調整されます。
この変更は、中心座標が引き続きジオ矩形の中心に位置するように行われるため、結果として、予想よりも高さが小さくなる場合があります。
180.0 は、新しい高さが 180 以上の場合にのみ使用される高さです。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
topLeft : QGeoCoordinate
このプロパティは、このジオ矩形の左上座標を保持します。
このプロパティはQt 5.5で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
| QGeoCoordinate | topLeft() const |
| void | setTopLeft(const QGeoCoordinate &topLeft) |
topRight : QGeoCoordinate
このプロパティは、このジオ矩形の右上の座標を保持します。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
| QGeoCoordinate | topRight() const |
| void | setTopRight(const QGeoCoordinate &topRight) |
width : double
このプロパティには、このジオ矩形の幅が度単位で格納されます。
このジオレクタングルが無効な場合、プロパティの値は未定義となります。
新しい幅が 0.0 未満の場合、またはこの地理的矩形が無効な場合、この関数は何も行いません。中心、幅、高さに基づいて無効な地理的矩形の値を設定するには、まずsetCenter() を使用して、地理的矩形を有効にする必要があります。
360.0 は、新しい幅が 360 以上の場合にのみ使用される幅です。そのような場合、地理矩形の最左端の経度は -180.0 度に、最右端の経度は 180.0 度に設定されます。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
メンバ関数のドキュメント
QGeoRectangle::QGeoRectangle()
無効な新しい地理的矩形を作成します。
QGeoRectangle::QGeoRectangle(const QGeoShape &other)
other の内容から、ジオ矩形を作成します。
QGeoRectangle::QGeoRectangle(const QList<QGeoCoordinate> &coordinates)
coordinates のすべてを含む、最小サイズの新しいジオ矩形を作成します。
QGeoRectangle::QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight)
左上座標がtopLeft 、右下座標がbottomRight である新しいジオ矩形を作成します。
QGeoRectangle::QGeoRectangle(const QGeoCoordinate ¢er, double degreesWidth, double degreesHeight)
center を中心とし、幅をdegreesWidth 度、高さをdegreesHeight 度とする新しいジオ矩形を作成します。
degreesHeight によってジオ矩形が極のいずれかを超過することになる場合、ジオ矩形の高さは、ジオ矩形が極までしか伸びないよう切り詰められます。ジオ矩形の中心は変更されず、中心点が切り詰められたジオ矩形の中心に位置するように高さが調整されます。
QGeoRectangle::QGeoRectangle(const QGeoRectangle &other)
other の内容から、地理座標の矩形を作成します。
[noexcept] QGeoRectangle::~QGeoRectangle()
このジオメトリ矩形を削除します。
QGeoCoordinate QGeoRectangle::bottomLeft() const
このジオ矩形の左下座標を返します。
注: プロパティ bottomLeft のゲッター 関数です。
関連項目: setBottomLeft()。
QGeoCoordinate QGeoRectangle::bottomRight() const
このジオ矩形の右下座標を返します。
注: プロパティ bottomRight のゲッター 関数です。
関連項目: setBottomRight()。
QGeoCoordinate QGeoRectangle::center() const
このジオ矩形の中心を返します。QGeoShape::center() と同等です。
注: プロパティ centerのゲッター 関数です。
関連項目: setCenter()。
bool QGeoRectangle::contains(const QGeoRectangle &rectangle) const
地理矩形 `rectangle ` が、この地理矩形内に含まれているかどうかを返します。
[invokable] void QGeoRectangle::extendRectangle(const QGeoCoordinate &coordinate)
geo矩形を拡張して、その座標もカバーするようにしますcoordinate
注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
double QGeoRectangle::height() const
このジオ矩形の高さを度単位で返します。
このジオ矩形が無効な場合、戻り値は未定義となります。
注: プロパティ `height`のゲッター 関数です。
関連項目: setHeight()。
[invokable] bool QGeoRectangle::intersects(const QGeoRectangle &rectangle) const
地理矩形 `rectangle ` がこの地理矩形と交差するかどうかを返します。
両方のジオ矩形の上辺または下辺が極のいずれかに位置する場合、辺が極にあるときは経度が関係なくなるため、それらのジオ矩形は交差しているとみなされます。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
void QGeoRectangle::setBottomLeft(const QGeoCoordinate &bottomLeft)
このジオ矩形の左下座標を `bottomLeft` に設定します。
注: プロパティ `bottomLeft`のセッター 関数です。
bottomLeft()も参照してください 。
void QGeoRectangle::setBottomRight(const QGeoCoordinate &bottomRight)
このジオ矩形の右下座標を `bottomRight` に設定します。
注: プロパティ `bottomRight`のセッター 関数です。
bottomRight()も参照してください 。
void QGeoRectangle::setCenter(const QGeoCoordinate ¢er)
このジオ矩形の中心をcenter に設定します。
これによりジオ矩形が極のいずれかと重なる場合、ジオ矩形の高さは、ジオ矩形が極までしか伸びないよう切り詰められます。ジオ矩形の中心は変更されず、中心点が切り詰められたジオ矩形の中心に位置するように高さが調整されます。
注: プロパティ `center`のセッター 関数です。
関連項目: center()。
void QGeoRectangle::setHeight(double degreesHeight)
このジオ矩形の高さを、度単位でdegreesHeight に設定します。
注: プロパティ `height`のセッター 関数です。
height()も参照してください 。
void QGeoRectangle::setTopLeft(const QGeoCoordinate &topLeft)
このジオ矩形の左上座標を `topLeft` に設定します。
注: プロパティ `topLeft`のセッター 関数です。
topLeft()も参照してください 。
void QGeoRectangle::setTopRight(const QGeoCoordinate &topRight)
このジオ矩形の右上の座標を `topRight` に設定します。
注: プロパティ `topRight`のセッター 関数です。
topRight()も参照してください 。
void QGeoRectangle::setWidth(double degreesWidth)
このジオ矩形の幅を、度単位でdegreesWidth に設定します。
注: width プロパティのセッター 関数です。
width()も参照してください 。
[invokable] QString QGeoRectangle::toString() const
geo矩形のプロパティを文字列として返します。
注:この関数は 、メタオブジェクトシステムを介して、またはQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
QGeoCoordinate QGeoRectangle::topLeft() const
このジオ矩形の左上座標を返します。
注: プロパティ topLeft のゲッター 関数です。
関連項目: setTopLeft()。
QGeoCoordinate QGeoRectangle::topRight() const
このジオレクタングルの右上の座標を返します。
注: プロパティ topRight のゲッター 関数です。
関連項目: setTopRight()。
[invokable] void QGeoRectangle::translate(double degreesLatitude, double degreesLongitude)
この地理的矩形を、degreesLatitude だけ北方向に、degreesLongitude だけ東方向に移動させます。
degreesLatitude およびdegreesLongitude の負の値は、それぞれ南方向および西方向への平行移動に対応します。
この平行移動によってジオ矩形が極を横切ることになる場合、ジオ矩形の上辺または下辺が極に接触するまで平行移動が行われますが、それ以上は移動しません。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] QGeoRectangle QGeoRectangle::translated(double degreesLatitude, double degreesLongitude) const
この地理的矩形を、degreesLatitude だけ北方向に、degreesLongitude だけ東方向に移動させたコピーを返します。
degreesLatitude およびdegreesLongitude の負の値は、それぞれ南方向および西方向への平行移動に対応します。
注:この関数は 、メタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。
translate()も参照してください 。
[invokable] QGeoRectangle QGeoRectangle::united(const QGeoRectangle &rectangle) const
このジオ矩形とrectangle の両方を含む、最小のジオ矩形を返します。
2つのジオ矩形の中心がちょうど180.0度離れている場合、幅は360.0度に設定され、最左の経度は-180.0度、最右の経度は180.0度に設定されます。 これは、結果がオペランドの順序に依存しないようにするためです。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
double QGeoRectangle::width() const
このジオ矩形の幅を度単位で返します。
このジオ矩形が無効な場合、戻り値は未定義となります。
注: プロパティ widthのゲッター 関数です。
関連項目: setWidth()。
QGeoRectangle &QGeoRectangle::operator=(const QGeoRectangle &other)
この地理的矩形にother を割り当て、この地理的矩形への参照を返します。
QGeoRectangle QGeoRectangle::operator|(const QGeoRectangle &rectangle) const
このジオ矩形とrectangle の両方を含む、最小のジオ矩形を返します。
2つのジオ矩形の中心がちょうど180.0度離れている場合、幅は360.0度に設定され、最左の経度は-180.0度、最右の経度は180.0度に設定されます。 これは、結果がオペランドの順序に依存しないようにするためです。
QGeoRectangle &QGeoRectangle::operator|=(const QGeoRectangle &rectangle)
このジオ矩形とrectangle の両方を含む、最小のジオ矩形を返します。
2つのジオ矩形の中心がちょうど180.0度離れている場合、幅は360.0度に設定され、左端の経度は-180.0度、右端の経度は180.0度に設定されます。 これは、結果がオペランドの順序に依存しないようにするためです。
© 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.