summaryrefslogtreecommitdiff
path: root/src/imports/location/location.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/location.cpp
parent7dd46f8c96a4bdaca2809ff97b773f358392516f (diff)
downloadqtlocation-059388adce26be48868cd741b4c5d751298fb4d8.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/location.cpp')
-rw-r--r--src/imports/location/location.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp
index 0f6b4162..3013dbe4 100644
--- a/src/imports/location/location.cpp
+++ b/src/imports/location/location.cpp
@@ -93,6 +93,9 @@
#include <QtQml/private/qqmlglobal_p.h>
#include <QtQml/private/qqmlmetatype_p.h>
+#include <QtLocation/QGeoRectangle>
+#include <QtLocation/QGeoCircle>
+
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
@@ -132,13 +135,10 @@ public:
qmlRegisterSingletonType<LocationSingleton>(uri, 5, 0, "QtLocation", singleton_type_factory);
QQml_addValueTypeProvider(getValueTypeProvider());
- QQmlMetaType::registerCustomStringConverter(qMetaTypeId<QGeoCoordinate>(), stringToCoordinate);
+ qmlRegisterValueTypeEnums<GeoShapeValueType>("QtLocation", 5, 0, "GeoShape");
qmlRegisterType<QDeclarativePosition>(uri, 5, 0, "Position");
qmlRegisterType<QDeclarativePositionSource>(uri, 5, 0, "PositionSource");
- qmlRegisterUncreatableType<QDeclarativeGeoShape>(uri, 5, 0, "GeoShape", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Positioning)GeoShape"));
- qmlRegisterType<QDeclarativeGeoRectangle>(uri, 5, 0, "GeoRectangle");
- qmlRegisterType<QDeclarativeGeoCircle>(uri, 5, 0, "GeoCircle");
qmlRegisterType<QDeclarativeGeoAddress>(uri, 5, 0, "Address");
qmlRegisterType<QDeclarativeGeoServiceProvider>(uri, 5, 0, "Plugin");