diff options
-rw-r--r-- | src/imports/positioning/positioning.cpp | 10 | ||||
-rw-r--r-- | src/positioning/doc/src/cpp-position.qdoc | 2 | ||||
-rw-r--r-- | src/positioning/qgeocircle.cpp | 38 | ||||
-rw-r--r-- | src/positioning/qgeocoordinate.cpp | 64 | ||||
-rw-r--r-- | src/positioning/qgeorectangle.cpp | 130 | ||||
-rw-r--r-- | src/positioning/qgeoshape.cpp | 46 |
6 files changed, 260 insertions, 30 deletions
diff --git a/src/imports/positioning/positioning.cpp b/src/imports/positioning/positioning.cpp index 06d409e7..2a010be7 100644 --- a/src/imports/positioning/positioning.cpp +++ b/src/imports/positioning/positioning.cpp @@ -86,8 +86,8 @@ QT_BEGIN_NAMESPACE The latitude, longitude and altitude attributes stored in the coordinate type are represented as doubles, giving them approximately 16 decimal digits of precision -- enough to specify - micrometers. The calculations performed in coordinate's methods such as \l azimuthTo() and - \l distanceTo() also use doubles for all intermediate values, but the inherent inaccuracies in + micrometers. The calculations performed in coordinate's methods such as \l {azimuthTo}() and + \l {distanceTo}() also use doubles for all intermediate values, but the inherent inaccuracies in their spherical Earth model dominate the amount of error in their output. \section1 Example Usage @@ -132,6 +132,8 @@ QT_BEGIN_NAMESPACE and a negative latitude indicates the Southern Hemisphere. If the property has not been set, its default value is NaN. + For more details see the \l {QGeoCoordinate::latitude} property + \section2 longitude \code @@ -143,6 +145,8 @@ QT_BEGIN_NAMESPACE and a negative longitude indicates the Western Hemisphere If the property has not been set, its default value is NaN. + For more details see the \l {QGeoCoordinate::longitude} property + \section2 altitude \code @@ -152,6 +156,8 @@ QT_BEGIN_NAMESPACE This property holds the altitude value (meters above sea level). If the property has not been set, its default value is NaN. + For more details see the \l {QGeoCoordinate::altitude} property + \section2 isValid \code diff --git a/src/positioning/doc/src/cpp-position.qdoc b/src/positioning/doc/src/cpp-position.qdoc index e5e770fb..34f39bdc 100644 --- a/src/positioning/doc/src/cpp-position.qdoc +++ b/src/positioning/doc/src/cpp-position.qdoc @@ -179,7 +179,7 @@ to create a custom positioning source. \section3 \b{Flickr Example} -The \l{Flickr QML}{Flickr Example} uses the Location to download thumbnail +The \l{GeoFlickr QML}{Flickr Example} uses the current location to download thumbnail images from Flickr relevant to the current location. diff --git a/src/positioning/qgeocircle.cpp b/src/positioning/qgeocircle.cpp index 991c0892..7201b46b 100644 --- a/src/positioning/qgeocircle.cpp +++ b/src/positioning/qgeocircle.cpp @@ -55,6 +55,38 @@ QT_BEGIN_NAMESPACE The circle is considered invalid if the center coordinate is invalid or if the radius is less than zero. + + This class is a \l Q_GADGET since Qt 5.5. +*/ + +/*! + \property QGeoCircle::center + \brief This property holds the center coordinate for the geo circle. + + The circle is considered invalid if this property contains an invalid + coordinate. + + A default constructed QGeoCircle uses an invalid \l QGeoCoordinate + as center. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoCircle::radius + \brief This property holds the circle radius in meters. + + The circle is considered invalid if this property is negative. + + By default, the radius is initialized with \c -1. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 */ inline QGeoCirclePrivate *QGeoCircle::d_func() @@ -272,6 +304,12 @@ QGeoCircle QGeoCircle::translated(double degreesLatitude, double degreesLongitud return result; } +/*! + Returns the geo circle properties as a string. + + \since 5.5 +*/ + QString QGeoCircle::toString() const { if (type() != QGeoShape::CircleType) { diff --git a/src/positioning/qgeocoordinate.cpp b/src/positioning/qgeocoordinate.cpp index bbf4fdb9..ee50182f 100644 --- a/src/positioning/qgeocoordinate.cpp +++ b/src/positioning/qgeocoordinate.cpp @@ -98,6 +98,8 @@ QGeoCoordinatePrivate::~QGeoCoordinatePrivate() including WGS84. Azimuth in this context is equivalent to a compass bearing based on true north. + + This class is a \l Q_GADGET since Qt 5.5. */ /*! @@ -123,6 +125,66 @@ QGeoCoordinatePrivate::~QGeoCoordinatePrivate() \sa toString() */ +/*! + \property QGeoCoordinate::latitude + \brief This property holds the latitude in decimal degrees. + + The property is undefined (\l {qQNaN()}) if the latitude has not been set. + A positive latitude indicates the Northern Hemisphere, and a negative + latitude indicates the Southern Hemisphere. When setting the latitude the + new value should be in the + \l {http://en.wikipedia.org/wiki/World_Geodetic_System}{WGS84} datum format. + + To be valid, the latitude must be between -90 to 90 inclusive. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoCoordinate::longitude + \brief This property holds the longitude in decimal degrees. + + The property is undefined (\l {qQNaN()}) if the longitude has not been set. + A positive longitude indicates the Eastern Hemisphere, and a negative + longitude indicates the Western Hemisphere. When setting the longitude the + new value should be in the + \l {http://en.wikipedia.org/wiki/World_Geodetic_System}{WGS84} datum format. + + To be valid, the longitude must be between -180 to 180 inclusive. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoCoordinate::altitude + \brief This property holds the altitude in meters above sea level. + + The property is undefined (\l {qQNaN()}) if the altitude has not been set. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoCoordinate::isValid + \brief This property holds the validity of this geo coordinate. + + The geo coordinate is valid if the \l [CPP]{longitude} and \l [CPP]{latitude} + properties have been set to valid values. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ /*! Constructs a coordinate. The coordinate will be invalid until @@ -228,7 +290,7 @@ bool QGeoCoordinate::operator==(const QGeoCoordinate &other) const */ /*! - Returns true if the type() is Coordinate2D or Coordinate3D. + Returns true if the \l longitude and \l latitude are valid. */ bool QGeoCoordinate::isValid() const { diff --git a/src/positioning/qgeorectangle.cpp b/src/positioning/qgeorectangle.cpp index b8e42832..aaa1e612 100644 --- a/src/positioning/qgeorectangle.cpp +++ b/src/positioning/qgeorectangle.cpp @@ -65,6 +65,108 @@ QT_BEGIN_NAMESPACE cross one of the poles the height is modified such that the geo rectangle touches but does not cross the pole and that the center coordinate is still in the center of the geo rectangle. + + This class is a \l Q_GADGET since Qt 5.5. +*/ + +/*! + \property QGeoRectangle::bottomLeft + \brief This property holds the bottom left coorindate of this geo rectangle. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoRectangle::bottomRight + \brief This property holds the bottom right coordinate of this geo rectangle. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoRectangle::topLeft + \brief This property holds the top left coordinate of this geo rectangle. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoRectangle::topRight + \brief This property holds the top right coordinate of this geo rectangle. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoRectangle::center + \brief This property holds the center of this geo rectangle. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \sa QGeoShape::center + + \since 5.5 +*/ + +/*! + \property QGeoRectangle::width + \brief This property holds the width of this geo rectangle in degrees. + + The property value is undefined if this geo rectangle is invalid. + + If the new width is less than 0.0 or if this geo rectangle is invalid, this + function does nothing. To set up the values of an invalid + geo rectangle based on the center, width, and height, you should use + \l setCenter() first to make the geo rectangle valid. + + 360.0 is the width used only if the new width is equal or greater than 360. + In such cases the leftmost longitude of the geo rectangle is set to -180.0 + degrees and the rightmost longitude of the geo rectangle is set to 180.0 + degrees. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoRectangle::height + \brief This property holds the height of this geo rectangle in degrees. + + The property value is undefined if this geo rectangle is invalid. + + If the new height is less than 0.0 or if this geo rectangle is invalid, + the property is not changed. To set up the values of an invalid + geo rectangle based on the center, width, and height, you should use + \l setCenter() first to make the geo rectangle valid. + + If the change in height would cause the geo rectangle to cross a pole, + the height is adjusted such that the geo rectangle only touches the pole. + + This change is done such that the center coordinate is still at the + center of the geo rectangle, which may result in a geo rectangle with + a smaller height than expected. + + 180.0 is the height used only if the new height is greater or equal than 180. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 */ inline QGeoRectanglePrivate *QGeoRectangle::d_func() @@ -365,15 +467,6 @@ QGeoCoordinate QGeoRectangle::center() const /*! Sets the width of this geo rectangle in degrees to \a degreesWidth. - - If \a degreesWidth is less than 0.0 or if this geo rectangle is invalid this - function does nothing. To set up the values of an invalid - geo rectangle based on the center, width and height you should use - setCenter() first in order to make the geo rectangle valid. - - If \a degreesWidth is greater than 360.0 then 360.0 is used as the width, - the leftmost longitude of the geo rectangle is set to -180.0 degrees and the - rightmost longitude of the geo rectangle is set to 180.0 degrees. */ void QGeoRectangle::setWidth(double degreesWidth) { @@ -437,20 +530,6 @@ double QGeoRectangle::width() const /*! Sets the height of this geo rectangle in degrees to \a degreesHeight. - - If \a degreesHeight is less than 0.0 or if this geo rectangle is invalid - this function does nothing. To set up the values of an invalid - geo rectangle based on the center, width and height you should use - setCenter() first in order to make the geo rectangle valid. - - If the change in height would cause the geo rectangle to cross a pole - the height is adjusted such that the geo rectangle only touches the pole. - - This change is done such that the center coordinate is still at the - center of the geo rectangle, which may result in a geo rectangle with - a smaller height than might otherwise be expected. - - If \a degreesHeight is greater than 180.0 then 180.0 is used as the height. */ void QGeoRectangle::setHeight(double degreesHeight) { @@ -899,6 +978,11 @@ QGeoRectangle &QGeoRectangle::operator|=(const QGeoRectangle &rectangle) return *this; } +/*! + Returns the geo rectangle properties as a string. + + \since 5.5 +*/ QString QGeoRectangle::toString() const { if (type() != QGeoShape::RectangleType) { diff --git a/src/positioning/qgeoshape.cpp b/src/positioning/qgeoshape.cpp index c8353e21..2861eb8f 100644 --- a/src/positioning/qgeoshape.cpp +++ b/src/positioning/qgeoshape.cpp @@ -74,6 +74,8 @@ bool QGeoShapePrivate::operator==(const QGeoShapePrivate &other) const For the sake of consistency, subclasses should describe the specific details of the associated areas in terms of QGeoCoordinate instances and distances in meters. + + This class is a \l Q_GADGET since Qt 5.5. */ /*! @@ -86,6 +88,42 @@ bool QGeoShapePrivate::operator==(const QGeoShapePrivate &other) const \value CircleType A circular shape. */ +/*! + \property QGeoShape::type + \brief This property holds the type of this geo shape. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoShape::isValid + \brief This property holds the validity of the geo shape. + + A geo shape is considered to be invalid if some of the data that is required to + unambiguously describe the geo shape has not been set or has been set to an + unsuitable value depending on the subclass of this object. The default constructed + objects of this type are invalid. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ + +/*! + \property QGeoShape::isEmpty + \brief This property defines whether this geo shape is empty. + + An empty geo shape is a region which has a geometrical area of 0. + + While this property is introduced in Qt 5.5, the related accessor functions + exist since the first version of this class. + + \since 5.5 +*/ inline QGeoShapePrivate *QGeoShape::d_func() { return static_cast<QGeoShapePrivate *>(d_ptr.data()); @@ -142,9 +180,6 @@ QGeoShape::ShapeType QGeoShape::type() const /*! Returns whether this geo shape is valid. - An geo shape is considered to be invalid if some of the data that is required to - unambiguously describe the geo shape has not been set or has been set to an - unsuitable value. */ bool QGeoShape::isValid() const { @@ -249,6 +284,11 @@ QGeoShape &QGeoShape::operator=(const QGeoShape &other) return *this; } +/*! + Returns a string representation of this geo shape. + + \since 5.5 +*/ QString QGeoShape::toString() const { return QStringLiteral("QGeoShape(%1)").arg(type()); |