summaryrefslogtreecommitdiff
path: root/src/imports/location/locationsingleton.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2012-08-16 13:32:43 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-28 10:07:49 +0200
commit059388adce26be48868cd741b4c5d751298fb4d8 (patch)
tree1a8a41c0f280b7ab3c502b49527bd609d1c0884a /src/imports/location/locationsingleton.cpp
parent7dd46f8c96a4bdaca2809ff97b773f358392516f (diff)
downloadqtlocation-57906260cc8fdff3cde3c693857a084f3ecca95e.tar.gz
Convert GeoShape, GeoRectangle and GeoCircle into QML value types.v5.0.0-beta1
This replaces the GeoShape, GeoRectangle and GeoCircle QML elements with value types. A value type is a better fit for shape types. It is very similar to a rect with some utility functions. Declare QGeoShape, QGeoRectangle and QGeoCircle as movable types. Update documentation. Change-Id: Id6c48e1e841c68f2f0c5c6a9c4a6580a57e2dfb6 Reviewed-by: abcd <amos.choy@nokia.com>
Diffstat (limited to 'src/imports/location/locationsingleton.cpp')
-rw-r--r--src/imports/location/locationsingleton.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/imports/location/locationsingleton.cpp b/src/imports/location/locationsingleton.cpp
index e5997627..7caa76f4 100644
--- a/src/imports/location/locationsingleton.cpp
+++ b/src/imports/location/locationsingleton.cpp
@@ -89,3 +89,77 @@ QGeoCoordinate LocationSingleton::coordinate(double latitude, double longitude,
return QGeoCoordinate(latitude, longitude, altitude);
}
+/*!
+ \qmlmethod geoshape QtLocation5::QtLocation::shape() const
+
+ Constructs an invalid geoshape.
+
+ \sa {QtLocation5::geoshape}{geoshape}
+*/
+QGeoShape LocationSingleton::shape() const
+{
+ return QGeoShape();
+}
+
+/*!
+ \qmlmethod georectangle QtLocation5::QtLocation::rectangle() const
+
+ Constructs an invalid georectangle.
+
+ \sa {QtLocation5::georectangle}{georectangle}
+*/
+QGeoRectangle LocationSingleton::rectangle() const
+{
+ return QGeoRectangle();
+}
+
+/*!
+ \qmlmethod georectangle QtLocation5::QtLocation::rectangle(coordinate center, real width, real height) const
+
+ Constructs a georectangle centered at \a center with a width of \a width degrees and a hight of
+ \a height degrees.
+
+ \sa {QtLocation5::georectangle}{georectangle}
+*/
+QGeoRectangle LocationSingleton::rectangle(const QGeoCoordinate &center,
+ double width, double height) const
+{
+ return QGeoRectangle(center, width, height);
+}
+
+/*!
+ \qmlmethod georectangle QtLocation5::QtLocation::rectangle(coordinate topLeft, coordinate bottomRight) const
+
+ Constructs a georectangle with its top left corner positioned at \a topLeft and its bottom
+ right corner positioned at \a {bottomLeft}.
+
+ \sa {QtLocation5::georectangle}{georectangle}
+*/
+QGeoRectangle LocationSingleton::rectangle(const QGeoCoordinate &topLeft,
+ const QGeoCoordinate &bottomRight) const
+{
+ return QGeoRectangle(topLeft, bottomRight);
+}
+
+/*!
+ \qmlmethod geocircle QtLocation5::QtLocation::circle() const
+
+ Constructs an invalid geocircle.
+
+ \sa {QtLocation5::geocircle}{geocircle}
+*/
+QGeoCircle LocationSingleton::circle() const
+{
+ return QGeoCircle();
+}
+
+/*!
+ \qmlmethod geocircle QtLocation5::QtLocation::circle(coordinate center, real radius) const
+
+ Constructs a geocircle centered at \a center with a radius of \a radius meters.
+*/
+QGeoCircle LocationSingleton::circle(const QGeoCoordinate &center, qreal radius) const
+{
+ return QGeoCircle(center, radius);
+}
+