summaryrefslogtreecommitdiff
path: root/src/imports
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2013-08-16 10:02:13 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-02 14:30:40 +0200
commitd35d28017d731dba9e2a4f2622d2cec97e724e55 (patch)
treefd1fbbaeb20c641ca868a424f3ee051c7c6c3a28 /src/imports
parentea5f625ab90406d7407bc961b90b3993230dd03a (diff)
downloadqtlocation-d35d28017d731dba9e2a4f2622d2cec97e724e55.tar.gz
Split QtLocation into QtPositioning and QtLocation
QtPositioning is not dependent on any gui component and mostly covers everything around the retrieval of position information. QtLocation covers place, map and navigation APIs. Several documentation issues were fixed during the process. Change-Id: I98e2a53065549a2fc43f93a75b4f65b5bc884c92 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/imports.pro3
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplaceattribute.cpp2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp7
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp4
-rw-r--r--src/imports/location/location.cpp45
-rw-r--r--src/imports/location/location.pro27
-rw-r--r--src/imports/location/locationvaluetypehelper.cpp122
-rw-r--r--src/imports/location/locationvaluetypehelper_p.h54
-rw-r--r--src/imports/location/plugins.qmltypes165
-rw-r--r--src/imports/location/qdeclarativecirclemapitem.cpp4
-rw-r--r--src/imports/location/qdeclarativegeoaddress.cpp360
-rw-r--r--src/imports/location/qdeclarativegeoaddress_p.h113
-rw-r--r--src/imports/location/qdeclarativegeocodemodel.cpp9
-rw-r--r--src/imports/location/qdeclarativegeocodemodel_p.h4
-rw-r--r--src/imports/location/qdeclarativegeolocation.cpp193
-rw-r--r--src/imports/location/qdeclarativegeolocation_p.h94
-rw-r--r--src/imports/location/qdeclarativegeomaneuver_p.h2
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp1
-rw-r--r--src/imports/location/qdeclarativegeomapgesturearea.cpp1
-rw-r--r--src/imports/location/qdeclarativegeomapitembase_p.h1
-rw-r--r--src/imports/location/qdeclarativegeomapmousearea_p.h1
-rw-r--r--src/imports/location/qdeclarativegeomapmouseevent_p.h2
-rw-r--r--src/imports/location/qdeclarativegeomapquickitem.cpp1
-rw-r--r--src/imports/location/qdeclarativegeomapquickitem_p.h1
-rw-r--r--src/imports/location/qdeclarativegeoroute.cpp8
-rw-r--r--src/imports/location/qdeclarativegeoroute_p.h1
-rw-r--r--src/imports/location/qdeclarativegeoroutemodel.cpp18
-rw-r--r--src/imports/location/qdeclarativegeoroutemodel_p.h4
-rw-r--r--src/imports/location/qdeclarativegeoroutesegment.cpp2
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp11
-rw-r--r--src/imports/location/qdeclarativepolylinemapitem.cpp6
-rw-r--r--src/imports/location/qdeclarativerectanglemapitem.cpp4
-rw-r--r--src/imports/location/qdeclarativeroutemapitem.cpp4
-rw-r--r--src/imports/location/qdeclarativeroutemapitem_p.h1
-rw-r--r--src/imports/positioning/error_messages.cpp48
-rw-r--r--src/imports/positioning/error_messages.h54
-rw-r--r--src/imports/positioning/locationsingleton.cpp (renamed from src/imports/location/locationsingleton.cpp)29
-rw-r--r--src/imports/positioning/locationsingleton.h (renamed from src/imports/location/locationsingleton.h)10
-rw-r--r--src/imports/positioning/locationvaluetypeprovider.cpp (renamed from src/imports/location/locationvaluetypeprovider.cpp)85
-rw-r--r--src/imports/positioning/locationvaluetypeprovider.h (renamed from src/imports/location/locationvaluetypeprovider.h)10
-rw-r--r--src/imports/positioning/plugin.json2
-rw-r--r--src/imports/positioning/plugins.qmltypes167
-rw-r--r--src/imports/positioning/positioning.cpp123
-rw-r--r--src/imports/positioning/positioning.pro32
-rw-r--r--src/imports/positioning/qdeclarativecoordinate.cpp (renamed from src/imports/location/qdeclarativecoordinate.cpp)77
-rw-r--r--src/imports/positioning/qdeclarativecoordinate_p.h (renamed from src/imports/location/qdeclarativecoordinate_p.h)4
-rw-r--r--src/imports/positioning/qdeclarativegeocircle.cpp (renamed from src/imports/location/qdeclarativegeocircle.cpp)42
-rw-r--r--src/imports/positioning/qdeclarativegeocircle.h (renamed from src/imports/location/qdeclarativegeocircle.h)2
-rw-r--r--src/imports/positioning/qdeclarativegeorectangle.cpp (renamed from src/imports/location/qdeclarativegeorectangle.cpp)87
-rw-r--r--src/imports/positioning/qdeclarativegeorectangle.h (renamed from src/imports/location/qdeclarativegeorectangle.h)2
-rw-r--r--src/imports/positioning/qdeclarativegeoshape.cpp (renamed from src/imports/location/qdeclarativegeoshape.cpp)55
-rw-r--r--src/imports/positioning/qdeclarativegeoshape.h (renamed from src/imports/location/qdeclarativegeoshape.h)4
-rw-r--r--src/imports/positioning/qdeclarativeposition.cpp (renamed from src/imports/location/qdeclarativeposition.cpp)7
-rw-r--r--src/imports/positioning/qdeclarativeposition_p.h (renamed from src/imports/location/qdeclarativeposition_p.h)2
-rw-r--r--src/imports/positioning/qdeclarativepositionsource.cpp (renamed from src/imports/location/qdeclarativepositionsource.cpp)9
-rw-r--r--src/imports/positioning/qdeclarativepositionsource_p.h (renamed from src/imports/location/qdeclarativepositionsource_p.h)4
-rw-r--r--src/imports/positioning/qmldir3
59 files changed, 917 insertions, 1220 deletions
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index ad697cfb..ac340141 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
-qtHaveModule(3d): SUBDIRS += location
+qtHaveModule(positioning): SUBDIRS += positioning
+qtHaveModule(3d):qtHaveModule(location): SUBDIRS += location
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
index 5c60594b..208d955f 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
@@ -441,7 +441,7 @@ QPlace QDeclarativePlace::place()
}
/*!
- \qmlproperty QtLocation5::Location Place::location
+ \qmlproperty QtPositioning5::Location Place::location
This property holds the location of the place which can be used to retrieve the coordinate,
address and the bounding box.
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplaceattribute.cpp b/src/imports/location/declarativeplaces/qdeclarativeplaceattribute.cpp
index a2c596b6..fc3bb15c 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplaceattribute.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplaceattribute.cpp
@@ -101,7 +101,7 @@
\snippet declarative/places.qml ExtendedAttributes read
The following example shows how to assign and modify an attribute:
- \snippet declarative/places.qml
+ \snippet declarative/places.qml ExtendedAttributes write
\sa PlaceAttribute, QQmlPropertyMap
*/
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
index 46edd91e..217ff9da 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
@@ -48,7 +48,7 @@
#include <QtLocation/QPlaceManager>
#include <QtLocation/QPlaceSearchRequest>
#include <QtLocation/QPlaceSearchReply>
-#include <QtLocation/QGeoCircle>
+#include <QtPositioning/QGeoCircle>
QDeclarativeSearchModelBase::QDeclarativeSearchModelBase(QObject *parent)
: QAbstractListModel(parent), m_plugin(0), m_reply(0), m_complete(false), m_status(Null)
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
index 9a44dac1..8d182ea8 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
@@ -149,10 +149,9 @@ QT_USE_NAMESPACE
fetch search results, but rather performs a single fetch when \l update() is run. The \l count
is set to the number of search results returned during the fetch.
- \snippet declarative/places.qml QtQuick import
- \snippet declarative/places.qml QtLocation import
+ \snippet places_list/places_list.qml Imports
\codeline
- \snippet declarative/places.qml PlaceSearchModel
+ \snippet places_list/places_list.qml PlaceSearchModel
\sa CategoryModel, {QPlaceManager}
@@ -278,7 +277,7 @@ QT_USE_NAMESPACE
PlaceSearchModel {
id: model
plugin: backendPlugin
- searchArea: QtLocation.circle(QtLocation.coordinate(10, 10))
+ searchArea: QtPositioning.circle(QtPositioning.coordinate(10, 10))
...
}
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
index e344d8ea..f190cc4f 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
@@ -106,7 +106,7 @@ QT_USE_NAMESPACE
*/
/*!
- \qmlproperty GeoShape PlaceSearchSuggestionModel::searchArea
+ \qmlproperty geoshape PlaceSearchSuggestionModel::searchArea
This property holds the search area. Search suggestion results returned by the model will be
relevant to the given search area.
@@ -172,7 +172,7 @@ QT_USE_NAMESPACE
PlaceSeachSuggestionModel {
id: model
plugin: backendPlugin
- searchArea: QtLocation.circle(QtLocation.coordinate(10, 10))
+ searchArea: QtPositioning.circle(QtPositioning.coordinate(10, 10))
...
}
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp
index b3313c71..894d555e 100644
--- a/src/imports/location/location.cpp
+++ b/src/imports/location/location.cpp
@@ -39,17 +39,6 @@
**
****************************************************************************/
-#include "locationvaluetypeprovider.h"
-
-#include "qdeclarativepositionsource_p.h"
-#include "qdeclarativeposition_p.h"
-
-#include "qdeclarativegeoshape.h"
-#include "qdeclarativegeorectangle.h"
-#include "qdeclarativegeocircle.h"
-#include "qdeclarativegeoaddress_p.h"
-#include "qdeclarativecoordinate_p.h"
-
#include "qdeclarativegeoserviceprovider_p.h"
#include "qdeclarativegeomap_p.h"
@@ -71,7 +60,6 @@
//Place includes
#include "qdeclarativecategory_p.h"
-#include "qdeclarativegeolocation_p.h"
#include "qdeclarativeplace_p.h"
#include "qdeclarativeplaceattribute_p.h"
#include "qdeclarativeplaceicon_p.h"
@@ -85,34 +73,16 @@
#include "qdeclarativesearchsuggestionmodel_p.h"
#include "error_messages.h"
-#include "locationsingleton.h"
-
#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/qqml.h>
#include <QtQml/private/qqmlvaluetype_p.h>
#include <QtQml/private/qqmlglobal_p.h>
#include <QtQml/private/qqmlmetatype_p.h>
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCircle>
-
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
-static QObject *singleton_type_factory(QQmlEngine *engine, QJSEngine *jsEngine)
-{
- Q_UNUSED(engine)
- Q_UNUSED(jsEngine)
-
- return new LocationSingleton;
-}
-
-static LocationValueTypeProvider *getValueTypeProvider()
-{
- static LocationValueTypeProvider provider;
- return &provider;
-}
class QLocationDeclarativeModule: public QQmlExtensionPlugin
{
@@ -132,15 +102,6 @@ public:
// @uri QtLocation 5.0
- qmlRegisterSingletonType<LocationSingleton>(uri, 5, 0, "QtLocation", singleton_type_factory);
-
- QQml_addValueTypeProvider(getValueTypeProvider());
- qmlRegisterValueTypeEnums<GeoShapeValueType>(uri, 5, 0, "GeoShape");
-
- qmlRegisterType<QDeclarativePosition>(uri, 5, 0, "Position");
- qmlRegisterType<QDeclarativePositionSource>(uri, 5, 0, "PositionSource");
- qmlRegisterType<QDeclarativeGeoAddress>(uri, 5, 0, "Address");
-
qmlRegisterType<QDeclarativeGeoServiceProvider>(uri, 5, 0, "Plugin");
qmlRegisterType<QDeclarativeGeoServiceProviderParameter>(uri, 5, 0, "PluginParameter");
qmlRegisterUncreatableType<QDeclarativeGeoServiceProviderRequirements>(uri, 5, 0, "PluginRequirements", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("PluginRequirements"));
@@ -163,7 +124,6 @@ public:
qmlRegisterUncreatableType<QDeclarativeGeoMapType>(uri, 5, 0, "MapType", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("MapType"));
qmlRegisterType<QDeclarativeCategory>(uri, 5, 0, "Category");
qmlRegisterType<QDeclarativePlaceEditorialModel>(uri, 5, 0, "EditorialModel");
- qmlRegisterType<QDeclarativeGeoLocation>(uri, 5, 0, "Location");
qmlRegisterType<QDeclarativePlaceImageModel>(uri, 5, 0, "ImageModel");
qmlRegisterType<QDeclarativePlace>(uri, 5, 0, "Place");
qmlRegisterType<QDeclarativePlaceIcon>(uri, 5, 0, "Icon");
@@ -189,11 +149,6 @@ public:
qmlRegisterUncreatableType<QDeclarativeContactDetails>(uri, 5, 0, "ContactDetails", "ContactDetails instances cannot be instantiated. "
"Only Place types have ContactDetails and they cannot "
"be re-assigned (but can be modified).");
- qRegisterMetaType<QGeoCoordinate>("QGeoCoordinate");
- qRegisterMetaType<QGeoAddress>("QGeoAddress");
- qRegisterMetaType<QGeoRectangle>("QGeoRectangle");
- qRegisterMetaType<QGeoCircle>("QGeoCircle");
- qRegisterMetaType<QGeoLocation>("QGeoLocation");
qRegisterMetaType<QPlaceCategory>("QPlaceCategory");
qRegisterMetaType<QPlace>("QPlace");
qRegisterMetaType<QPlaceIcon>("QPlaceIcon");
diff --git a/src/imports/location/location.pro b/src/imports/location/location.pro
index 4c110ddd..8dccfa2d 100644
--- a/src/imports/location/location.pro
+++ b/src/imports/location/location.pro
@@ -1,7 +1,8 @@
-QT += quick-private network location-private qml-private 3d core-private gui-private
+QT += quick-private network positioning-private location-private qml-private 3d core-private gui-private
INCLUDEPATH += ../../location
INCLUDEPATH += ../../location/maps
+INCLUDEPATH += ../../positioning
INCLUDEPATH *= $$PWD
LIBS += -L../../3rdparty/poly2tri -lpoly2tri
@@ -14,18 +15,11 @@ win32 {
}
}
-HEADERS += qdeclarativeposition_p.h \
- qdeclarativepositionsource_p.h \
- qdeclarativecoordinate_p.h \
- qdeclarativegeolocation_p.h \
+HEADERS += \
qdeclarativegeomapitemview_p.h \
qdeclarativegeomapmouseevent_p.h \
qdeclarativegeomapmousearea_p.h \
qdeclarativegeoserviceprovider_p.h \
- qdeclarativegeoaddress_p.h \
- qdeclarativegeoshape.h \
- qdeclarativegeorectangle.h \
- qdeclarativegeocircle.h \
qdeclarativegeocodemodel_p.h \
qdeclarativegeoroutemodel_p.h \
qdeclarativegeoroute_p.h \
@@ -45,22 +39,14 @@ HEADERS += qdeclarativeposition_p.h \
qdeclarativegeomapcopyrightsnotice_p.h \
qdeclarativegeomapgesturearea_p.h \
error_messages.h \
- locationvaluetypeprovider.h \
- locationsingleton.h
+ locationvaluetypehelper_p.h
-SOURCES += qdeclarativeposition.cpp \
+SOURCES += \
location.cpp \
- qdeclarativepositionsource.cpp \
- qdeclarativecoordinate.cpp \
- qdeclarativegeolocation.cpp \
qdeclarativegeomapitemview.cpp \
qdeclarativegeomapmouseevent.cpp \
qdeclarativegeomapmousearea.cpp \
qdeclarativegeoserviceprovider.cpp \
- qdeclarativegeoaddress.cpp \
- qdeclarativegeoshape.cpp \
- qdeclarativegeorectangle.cpp \
- qdeclarativegeocircle.cpp \
qdeclarativegeocodemodel.cpp \
qdeclarativegeoroutemodel.cpp \
qdeclarativegeoroute.cpp \
@@ -80,8 +66,7 @@ SOURCES += qdeclarativeposition.cpp \
qdeclarativegeomapcopyrightsnotice.cpp \
qdeclarativegeomapgesturearea.cpp \
error_messages.cpp \
- locationvaluetypeprovider.cpp \
- locationsingleton.cpp
+ locationvaluetypehelper.cpp
include(declarativeplaces/declarativeplaces.pri)
diff --git a/src/imports/location/locationvaluetypehelper.cpp b/src/imports/location/locationvaluetypehelper.cpp
new file mode 100644
index 00000000..95790955
--- /dev/null
+++ b/src/imports/location/locationvaluetypehelper.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtLocation module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "locationvaluetypehelper_p.h"
+
+
+QGeoCoordinate parseCoordinate(const QJSValue &value, bool *ok)
+{
+ QGeoCoordinate c;
+
+ if (value.isObject()) {
+ if (value.hasProperty(QStringLiteral("latitude")))
+ c.setLatitude(value.property(QStringLiteral("latitude")).toNumber());
+ if (value.hasProperty(QStringLiteral("longitude")))
+ c.setLongitude(value.property(QStringLiteral("longitude")).toNumber());
+ if (value.hasProperty(QStringLiteral("altitude")))
+ c.setAltitude(value.property(QStringLiteral("altitude")).toNumber());
+
+ if (ok)
+ *ok = true;
+ }
+
+ return c;
+}
+
+QGeoRectangle parseRectangle(const QJSValue &value, bool *ok)
+{
+ QGeoRectangle r;
+
+ *ok = false;
+
+ if (value.isObject()) {
+ if (value.hasProperty(QStringLiteral("bottomLeft"))) {
+ QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("bottomLeft")), ok);
+ if (*ok)
+ r.setBottomLeft(c);
+ }
+ if (value.hasProperty(QStringLiteral("bottomRight"))) {
+ QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("bottomRight")), ok);
+ if (*ok)
+ r.setBottomRight(c);
+ }
+ if (value.hasProperty(QStringLiteral("topLeft"))) {
+ QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("topLeft")), ok);
+ if (*ok)
+ r.setTopLeft(c);
+ }
+ if (value.hasProperty(QStringLiteral("topRight"))) {
+ QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("topRight")), ok);
+ if (*ok)
+ r.setTopRight(c);
+ }
+ if (value.hasProperty(QStringLiteral("center"))) {
+ QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("center")), ok);
+ if (*ok)
+ r.setCenter(c);
+ }
+ if (value.hasProperty(QStringLiteral("height")))
+ r.setHeight(value.property(QStringLiteral("height")).toNumber());
+ if (value.hasProperty(QStringLiteral("width")))
+ r.setWidth(value.property(QStringLiteral("width")).toNumber());
+ }
+
+ return r;
+}
+
+QGeoCircle parseCircle(const QJSValue &value, bool *ok)
+{
+ QGeoCircle c;
+
+ *ok = false;
+
+ if (value.isObject()) {
+ if (value.hasProperty(QStringLiteral("center"))) {
+ QGeoCoordinate coord = parseCoordinate(value.property(QStringLiteral("center")), ok);
+ if (*ok)
+ c.setCenter(coord);
+ }
+ if (value.hasProperty(QStringLiteral("radius")))
+ c.setRadius(value.property(QStringLiteral("radius")).toNumber());
+ }
+
+ return c;
+}
diff --git a/src/imports/location/locationvaluetypehelper_p.h b/src/imports/location/locationvaluetypehelper_p.h
new file mode 100644
index 00000000..9c5bb481
--- /dev/null
+++ b/src/imports/location/locationvaluetypehelper_p.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtLocation module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LOCATION_VALUE_TYPE_HELPER
+#define LOCATION_VALUE_TYPE_HELPER
+
+#include <QJSValue>
+#include <QGeoCoordinate>
+#include <QGeoRectangle>
+#include <QGeoCircle>
+
+QGeoCoordinate parseCoordinate(const QJSValue &value, bool *ok);
+QGeoRectangle parseRectangle(const QJSValue &value, bool *ok);
+QGeoCircle parseCircle(const QJSValue &value, bool *ok);
+
+#endif
diff --git a/src/imports/location/plugins.qmltypes b/src/imports/location/plugins.qmltypes
index bb59436e..c4319665 100644
--- a/src/imports/location/plugins.qmltypes
+++ b/src/imports/location/plugins.qmltypes
@@ -7,75 +7,6 @@ import QtQuick.tooling 1.1
Module {
Component {
- name: "GeoShapeValueType"
- prototype: "QQmlValueType"
- exports: ["QtLocation/GeoShape 5.0"]
- exportMetaObjectRevisions: [0]
- Enum {
- name: "ShapeType"
- values: {
- "UnknownType": 0,
- "RectangleType": 1,
- "CircleType": 2
- }
- }
- Property { name: "type"; type: "ShapeType"; isReadonly: true }
- Property { name: "isValid"; type: "bool"; isReadonly: true }
- Property { name: "isEmpty"; type: "bool"; isReadonly: true }
- Method {
- name: "contains"
- type: "bool"
- Parameter { name: "coordinate"; type: "QGeoCoordinate" }
- }
- }
- Component {
- name: "LocationSingleton"
- prototype: "QObject"
- exports: ["QtLocation/QtLocation 5.0"]
- exportMetaObjectRevisions: [0]
- Method { name: "coordinate"; type: "QGeoCoordinate" }
- Method {
- name: "coordinate"
- type: "QGeoCoordinate"
- Parameter { name: "latitude"; type: "double" }
- Parameter { name: "longitude"; type: "double" }
- Parameter { name: "altitude"; type: "double" }
- }
- Method {
- name: "coordinate"
- type: "QGeoCoordinate"
- Parameter { name: "latitude"; type: "double" }
- Parameter { name: "longitude"; type: "double" }
- }
- Method { name: "shape"; type: "QGeoShape" }
- Method { name: "rectangle"; type: "QGeoRectangle" }
- Method {
- name: "rectangle"
- type: "QGeoRectangle"
- Parameter { name: "center"; type: "QGeoCoordinate" }
- Parameter { name: "width"; type: "double" }
- Parameter { name: "height"; type: "double" }
- }
- Method {
- name: "rectangle"
- type: "QGeoRectangle"
- Parameter { name: "topLeft"; type: "QGeoCoordinate" }
- Parameter { name: "bottomRight"; type: "QGeoCoordinate" }
- }
- Method { name: "circle"; type: "QGeoCircle" }
- Method {
- name: "circle"
- type: "QGeoCircle"
- Parameter { name: "center"; type: "QGeoCoordinate" }
- Parameter { name: "radius"; type: "double" }
- }
- Method {
- name: "circle"
- type: "QGeoCircle"
- Parameter { name: "center"; type: "QGeoCoordinate" }
- }
- }
- Component {
name: "QDeclarativeCategory"
prototype: "QObject"
exports: ["QtLocation/Category 5.0"]
@@ -157,33 +88,6 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
- name: "QDeclarativeGeoAddress"
- prototype: "QObject"
- exports: ["QtLocation/Address 5.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "address"; type: "QGeoAddress" }
- Property { name: "text"; type: "string" }
- Property { name: "country"; type: "string" }
- Property { name: "countryCode"; type: "string" }
- Property { name: "state"; type: "string" }
- Property { name: "county"; type: "string" }
- Property { name: "city"; type: "string" }
- Property { name: "district"; type: "string" }
- Property { name: "street"; type: "string" }
- Property { name: "postalCode"; type: "string" }
- Property { name: "isTextGenerated"; type: "bool"; isReadonly: true }
- }
- Component {
- name: "QDeclarativeGeoLocation"
- prototype: "QObject"
- exports: ["QtLocation/Location 5.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "location"; type: "QGeoLocation" }
- Property { name: "address"; type: "QDeclarativeGeoAddress"; isPointer: true }
- Property { name: "coordinate"; type: "QGeoCoordinate" }
- Property { name: "boundingBox"; type: "QGeoRectangle" }
- }
- Component {
name: "QDeclarativeGeoManeuver"
prototype: "QObject"
exports: ["QtLocation/RouteManeuver 5.0"]
@@ -1084,68 +988,6 @@ Module {
}
}
Component {
- name: "QDeclarativePosition"
- prototype: "QObject"
- exports: ["QtLocation/Position 5.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "latitudeValid"; type: "bool"; isReadonly: true }
- Property { name: "longitudeValid"; type: "bool"; isReadonly: true }
- Property { name: "altitudeValid"; type: "bool"; isReadonly: true }
- Property { name: "coordinate"; type: "QGeoCoordinate"; isReadonly: true }
- Property { name: "timestamp"; type: "QDateTime"; isReadonly: true }
- Property { name: "speed"; type: "double"; isReadonly: true }
- Property { name: "speedValid"; type: "bool"; isReadonly: true }
- Property { name: "horizontalAccuracy"; type: "double" }
- Property { name: "verticalAccuracy"; type: "double" }
- Property { name: "horizontalAccuracyValid"; type: "bool"; isReadonly: true }
- Property { name: "verticalAccuracyValid"; type: "bool"; isReadonly: true }
- }
- Component {
- name: "QDeclarativePositionSource"
- prototype: "QObject"
- exports: ["QtLocation/PositionSource 5.0"]
- exportMetaObjectRevisions: [0]
- Enum {
- name: "PositioningMethod"
- values: {
- "NoPositioningMethod": 0,
- "SatellitePositioningMethod": 255,
- "NonSatellitePositioningMethod": -256,
- "AllPositioningMethods": -1
- }
- }
- Enum {
- name: "PositioningMethods"
- values: {
- "NoPositioningMethod": 0,
- "SatellitePositioningMethod": 255,
- "NonSatellitePositioningMethod": -256,
- "AllPositioningMethods": -1
- }
- }
- Enum {
- name: "SourceError"
- values: {
- "AccessError": 0,
- "ClosedError": 1,
- "UnknownSourceError": -1
- }
- }
- Property { name: "position"; type: "QDeclarativePosition"; isReadonly: true; isPointer: true }
- Property { name: "active"; type: "bool" }
- Property { name: "valid"; type: "bool"; isReadonly: true }
- Property { name: "nmeaSource"; type: "QUrl" }
- Property { name: "updateInterval"; type: "int" }
- Property { name: "supportedPositioningMethods"; type: "PositioningMethods"; isReadonly: true }
- Property { name: "preferredPositioningMethods"; type: "PositioningMethods" }
- Property { name: "sourceError"; type: "SourceError"; isReadonly: true }
- Property { name: "name"; type: "string" }
- Signal { name: "validityChanged" }
- Method { name: "update" }
- Method { name: "start" }
- Method { name: "stop" }
- }
- Component {
name: "QDeclarativeRatings"
prototype: "QObject"
exports: ["QtLocation/Ratings 5.0"]
@@ -1238,7 +1080,8 @@ Module {
name: "SearchResultType"
values: {
"UnknownSearchResult": 0,
- "PlaceResult": 1
+ "PlaceResult": 1,
+ "ProposedSearchResult": 2
}
}
Enum {
@@ -1265,6 +1108,10 @@ Module {
Parameter { name: "index"; type: "int" }
Parameter { name: "roleName"; type: "string" }
}
+ Method {
+ name: "updateWith"
+ Parameter { name: "proposedSearchIndex"; type: "int" }
+ }
}
Component {
name: "QDeclarativeSearchSuggestionModel"
diff --git a/src/imports/location/qdeclarativecirclemapitem.cpp b/src/imports/location/qdeclarativecirclemapitem.cpp
index 7ffaa406..eb9d1272 100644
--- a/src/imports/location/qdeclarativecirclemapitem.cpp
+++ b/src/imports/location/qdeclarativecirclemapitem.cpp
@@ -319,10 +319,12 @@ QDeclarativeCircleMapItem::~QDeclarativeCircleMapItem()
}
/*!
+ \qmlpropertygroup Location::MapCircle::border
\qmlproperty int MapCircle::border.width
\qmlproperty color MapCircle::border.color
- These properties hold the width and color used to draw the border of the circle.
+ This property is part of the border group property.
+ The border property holds the width and color used to draw the border of the circle.
The width is in pixels and is independent of the zoom level of the map.
The default values correspond to a black border with a width of 1 pixel.
diff --git a/src/imports/location/qdeclarativegeoaddress.cpp b/src/imports/location/qdeclarativegeoaddress.cpp
deleted file mode 100644
index 3244cfc8..00000000
--- a/src/imports/location/qdeclarativegeoaddress.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************/
-
-#include "qdeclarativegeoaddress_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype Address
- \instantiates QDeclarativeGeoAddress
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
-
- \brief The Address QML type represents a specific location as a street address.
-
- An Address is used as a unit of data for queries such as (Reverse) Geocoding
- or Places searches -- many of these operations either accept an Address
- or return one.
-
- Not all properties of an Address are necessarily available or relevant
- in all parts of the world and all locales. The \l district, \l state and
- \l county properties are particularly area-specific for many data sources
- (including the provided Nokia plugin), and often only one or two of these
- is available or useful.
-
- The Address has a \l text property which holds a formatted string. It
- is the recommended way to display an address to the user and typically
- takes the format of an address as found on an envelope, but this is not always
- the case. The \l text may be automatically generated from constituent
- address properties such as \l street, \l city and and so on, but can also
- be explicitly assigned. See \l text for details.
-
- \section2 Example Usage
-
- The following code snippet shows the declaration of an Address object.
-
- \code
- Address {
- id: address
- street: "53 Brandl St"
- city: "Eight Mile Plains"
- country: "Australia"
- countryCode: "AUS"
- }
- \endcode
-
- This could then be used, for example, as the value of a \l{GeocodeModel}'s
- \l{GeocodeModel::query}{query} property, to get an exact longitude and
- latitude for the address.
-
- \sa {QGeoAddress}
-*/
-
-QDeclarativeGeoAddress::QDeclarativeGeoAddress(QObject *parent) :
- QObject(parent)
-{
-}
-
-QDeclarativeGeoAddress::QDeclarativeGeoAddress(const QGeoAddress &address, QObject *parent) :
- QObject(parent), m_address(address)
-{
-}
-
-/*!
- \qmlproperty QGeoAddress QtLocation5::Address::address
-
- For details on how to use this property to interface between C++ and QML see
- "\l {location-cpp-qml.html#geoaddress} {Interfaces between C++ and QML Code}".
-*/
-QGeoAddress QDeclarativeGeoAddress::address() const
-{
- return m_address;
-}
-
-void QDeclarativeGeoAddress::setAddress(const QGeoAddress &address)
-{
- // Elaborate but takes care of emiting needed signals
- setText(address.text());
- setCountry(address.country());
- setCountryCode(address.countryCode());
- setState(address.state());
- setCounty(address.county());
- setCity(address.city());
- setDistrict(address.district());
- setStreet(address.street());
- setPostalCode(address.postalCode());
- m_address = address;
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::text
-
- This property holds the address as a single formatted string. It is the recommended
- string to use to display the address to the user. It typically takes the format of
- an address as found on an envelope, but this is not always necessarily the case.
-
- The adddress \c text is either automatically generated or explicitly assigned,
- this can be determined by checking \l isTextGenerated.
-
- If an empty string is assigned to \c text, then \l isTextGenerated will be set
- to true and \c text will return a string which is locally formatted according to
- \l countryCode and based on the properties of the address. Modifying the address
- properties such as \l street, \l city and so on may cause the contents of \c text to
- change.
-
- If a non-empty string is assigned to \c text, then \l isTextGenerated will be
- set to false and \c text will always return the explicitly assigned string.
- Modifying address properties will not affect the \c text property.
-*/
-QString QDeclarativeGeoAddress::text() const
-{
- return m_address.text();
-}
-
-void QDeclarativeGeoAddress::setText(const QString &address)
-{
- QString oldText = m_address.text();
- bool oldIsTextGenerated = m_address.isTextGenerated();
- m_address.setText(address);
-
- if (oldText != m_address.text())
- emit textChanged();
- if (oldIsTextGenerated != m_address.isTextGenerated())
- emit isTextGeneratedChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::country
-
- This property holds the country of the address as a single formatted string.
-*/
-QString QDeclarativeGeoAddress::country() const
-{
- return m_address.country();
-}
-
-void QDeclarativeGeoAddress::setCountry(const QString &country)
-{
- if (m_address.country() == country)
- return;
- QString oldText = m_address.text();
- m_address.setCountry(country);
- emit countryChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::countryCode
-
- This property holds the country code of the address as a single formatted string.
-*/
-QString QDeclarativeGeoAddress::countryCode() const
-{
- return m_address.countryCode();
-}
-
-void QDeclarativeGeoAddress::setCountryCode(const QString &countryCode)
-{
- if (m_address.countryCode() == countryCode)
- return;
- QString oldText = m_address.text();
- m_address.setCountryCode(countryCode);
- emit countryCodeChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::state
-
- This property holds the state of the address as a single formatted string.
-*/
-QString QDeclarativeGeoAddress::state() const
-{
- return m_address.state();
-}
-
-void QDeclarativeGeoAddress::setState(const QString &state)
-{
- if (m_address.state() == state)
- return;
- QString oldText = m_address.text();
- m_address.setState(state);
- emit stateChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::county
-
- This property holds the county of the address as a single formatted string.
-*/
-QString QDeclarativeGeoAddress::county() const
-{
- return m_address.county();
-}
-
-void QDeclarativeGeoAddress::setCounty(const QString &county)
-{
- if (m_address.county() == county)
- return;
- QString oldText = m_address.text();
- m_address.setCounty(county);
- emit countyChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::city
-
- This property holds the city of the address as a single formatted string.
-*/
-QString QDeclarativeGeoAddress::city() const
-{
- return m_address.city();
-}
-
-void QDeclarativeGeoAddress::setCity(const QString &city)
-{
- if (m_address.city() == city)
- return;
- QString oldText = m_address.text();
- m_address.setCity(city);
- emit cityChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::district
-
- This property holds the district of the address as a single formatted string.
-*/
-QString QDeclarativeGeoAddress::district() const
-{
- return m_address.district();
-}
-
-void QDeclarativeGeoAddress::setDistrict(const QString &district)
-{
- if (m_address.district() == district)
- return;
- QString oldText = m_address.text();
- m_address.setDistrict(district);
- emit districtChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::street
-
- This property holds the street of the address but
- may also contain things like a unit number, a building
- name, or anything else that might be used to
- distinguish one address from another.
-*/
-QString QDeclarativeGeoAddress::street() const
-{
- return m_address.street();
-}
-
-void QDeclarativeGeoAddress::setStreet(const QString &street)
-{
- if (m_address.street() == street)
- return;
- QString oldText = m_address.text();
- m_address.setStreet(street);
- emit streetChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty string QtLocation5::Address::postalCode
-
- This property holds the postal code of the address as a single formatted string.
-*/
-QString QDeclarativeGeoAddress::postalCode() const
-{
- return m_address.postalCode();
-}
-
-void QDeclarativeGeoAddress::setPostalCode(const QString &postalCode)
-{
- if (m_address.postalCode() == postalCode)
- return;
- QString oldText = m_address.text();
- m_address.setPostalCode(postalCode);
- emit postalCodeChanged();
-
- if (m_address.isTextGenerated() && oldText != m_address.text())
- emit textChanged();
-}
-
-/*!
- \qmlproperty bool QtLocation5::Address::isTextGenerated
-
- This property holds a boolean that if true, indicates that \l text is automatically
- generated from address properties. If false, it indicates that the \l text has been
- explicitly assigned.
-
-*/
-bool QDeclarativeGeoAddress::isTextGenerated() const
-{
- return m_address.isTextGenerated();
-}
-
-#include "moc_qdeclarativegeoaddress_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeoaddress_p.h b/src/imports/location/qdeclarativegeoaddress_p.h
deleted file mode 100644
index 660145be..00000000
--- a/src/imports/location/qdeclarativegeoaddress_p.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************/
-
-#ifndef QDECLARATIVEGEOADDRESS_P_H
-#define QDECLARATIVEGEOADDRESS_P_H
-
-#include <qgeoaddress.h>
-#include <QtCore>
-#include <QtQml/qqml.h>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeGeoAddress : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(QGeoAddress address READ address WRITE setAddress)
- Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
- Q_PROPERTY(QString country READ country WRITE setCountry NOTIFY countryChanged)
- Q_PROPERTY(QString countryCode READ countryCode WRITE setCountryCode NOTIFY countryCodeChanged)
- Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
- Q_PROPERTY(QString county READ county WRITE setCounty NOTIFY countyChanged)
- Q_PROPERTY(QString city READ city WRITE setCity NOTIFY cityChanged)
- Q_PROPERTY(QString district READ district WRITE setDistrict NOTIFY districtChanged)
- Q_PROPERTY(QString street READ street WRITE setStreet NOTIFY streetChanged)
- Q_PROPERTY(QString postalCode READ postalCode WRITE setPostalCode NOTIFY postalCodeChanged)
- Q_PROPERTY(bool isTextGenerated READ isTextGenerated NOTIFY isTextGeneratedChanged)
-
-public:
- explicit QDeclarativeGeoAddress(QObject *parent = 0);
- QDeclarativeGeoAddress(const QGeoAddress &address, QObject *parent = 0);
- QGeoAddress address() const;
- void setAddress(const QGeoAddress &address);
-
- QString text() const;
- void setText(const QString &address);
-
- QString country() const;
- void setCountry(const QString &country);
- QString countryCode() const;
- void setCountryCode(const QString &countryCode);
- QString state() const;
- void setState(const QString &state);
- QString county() const;
- void setCounty(const QString &county);
- QString city() const;
- void setCity(const QString &city);
- QString district() const;
- void setDistrict(const QString &district);
- QString street() const;
- void setStreet(const QString &street);
- QString postalCode() const;
- void setPostalCode(const QString &postalCode);
- bool isTextGenerated() const;
-
-Q_SIGNALS:
- void textChanged();
- void countryChanged();
- void countryCodeChanged();
- void stateChanged();
- void countyChanged();
- void cityChanged();
- void districtChanged();
- void streetChanged();
- void postalCodeChanged();
- void isTextGeneratedChanged();
-
-private:
- QGeoAddress m_address;
-};
-
-QT_END_NAMESPACE
-QML_DECLARE_TYPE(QDeclarativeGeoAddress)
-
-#endif // QDECLARATIVEGEOADDRESS_P_H
diff --git a/src/imports/location/qdeclarativegeocodemodel.cpp b/src/imports/location/qdeclarativegeocodemodel.cpp
index ca22a270..d242ec75 100644
--- a/src/imports/location/qdeclarativegeocodemodel.cpp
+++ b/src/imports/location/qdeclarativegeocodemodel.cpp
@@ -41,12 +41,11 @@
#include "qdeclarativegeocodemodel_p.h"
#include "error_messages.h"
-#include "qdeclarativegeolocation_p.h"
#include <QtQml/qqmlinfo.h>
#include <QtLocation/QGeoServiceProvider>
#include <QtLocation/QGeocodingManager>
-#include <QtLocation/QGeoCircle>
+#include <QtPositioning/QGeoCircle>
QT_BEGIN_NAMESPACE
@@ -332,10 +331,10 @@ void QDeclarativeGeocodeModel::setBounds(const QVariant &boundingArea)
}
/*!
- \qmlproperty GeoShape QtLocation5::GeocodeModel::bounds
+ \qmlproperty geoshape QtLocation5::GeocodeModel::bounds
This property holds the bounding area used to limit the results to those
- within the area. his is particularly useful if query is only partially filled out,
+ within the area. This is particularly useful if query is only partially filled out,
as the service will attempt to (reverse) geocode all matches for the specified data.
Accepted types are \l {georectangle} and
@@ -498,7 +497,7 @@ int QDeclarativeGeocodeModel::count() const
}
/*!
- \qmlmethod QtLocation5::GeocodeModel::get(int)
+ \qmlmethod Location QtLocation5::GeocodeModel::get(int)
Returns the Location at given index. Use \l count property to check the
amount of locations available. The locations are indexed from zero, so the accessible range
diff --git a/src/imports/location/qdeclarativegeocodemodel_p.h b/src/imports/location/qdeclarativegeocodemodel_p.h
index 66d34d6d..f5b16a25 100644
--- a/src/imports/location/qdeclarativegeocodemodel_p.h
+++ b/src/imports/location/qdeclarativegeocodemodel_p.h
@@ -44,12 +44,12 @@
#include "qdeclarativegeoserviceprovider_p.h"
-#include "qdeclarativegeocircle.h"
#include <qgeocodereply.h>
+#include <QtPositioning/private/qdeclarativegeoaddress_p.h>
+#include <QtPositioning/private/qdeclarativegeolocation_p.h>
#include <QtQml/qqml.h>
#include <QtQml/QQmlParserStatus>
-#include "qdeclarativegeolocation_p.h"
#include <QAbstractListModel>
#include <QPointer>
diff --git a/src/imports/location/qdeclarativegeolocation.cpp b/src/imports/location/qdeclarativegeolocation.cpp
deleted file mode 100644
index 404a821d..00000000
--- a/src/imports/location/qdeclarativegeolocation.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativegeolocation_p.h"
-
-QT_USE_NAMESPACE
-
-/*!
- \qmltype Location
- \instantiates QDeclarativeGeoLocation
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
-
- \brief The Location type holds location data.
-
- Location types represent a geographic "location", in a human sense. This
- consists of a specific \l {coordinate}, an \l {address} and a \l {boundingBox}{bounding box}.
- The \l {boundingBox}{bounding box} represents the recommended region
- to display when viewing this location.
-
- The Location type is most commonly seen as the contents of a search
- model such as the GeocodeModel. When a GeocodeModel returns the list of
- locations found for a given query, it represents these as Location objects.
-
- \section2 Example Usage
-
- The following example shows a simple Location object being declared:
-
- \code
- Location {
- coordinate {
- latitude: -27.3
- longitude: 153.1
- }
- address: Address {
- ...
- }
- }
- \endcode
-*/
-
-QDeclarativeGeoLocation::QDeclarativeGeoLocation(QObject *parent)
-: QObject(parent), m_address(0)
-
-{
- setLocation(QGeoLocation());
-}
-
-QDeclarativeGeoLocation::QDeclarativeGeoLocation(const QGeoLocation &src, QObject *parent)
-: QObject(parent), m_address(0)
-{
- setLocation(src);
-}
-
-QDeclarativeGeoLocation::~QDeclarativeGeoLocation()
-{
-}
-
-/*!
- \qmlproperty QGeoLocation QtLocation5::Location::location
-
- For details on how to use this property to interface between C++ and QML see
- "\l {location-cpp-qml.html#location} {Interfaces between C++ and QML Code}".
-*/
-void QDeclarativeGeoLocation::setLocation(const QGeoLocation &src)
-{
- if (m_address && m_address->parent() == this) {
- m_address->setAddress(src.address());
- } else if (!m_address || m_address->parent() != this) {
- m_address = new QDeclarativeGeoAddress(src.address(), this);
- emit addressChanged();
- }
-
- setCoordinate(src.coordinate());
- setBoundingBox(src.boundingBox());
-}
-
-QGeoLocation QDeclarativeGeoLocation::location() const
-{
- QGeoLocation retValue;
- retValue.setAddress(m_address ? m_address->address() : QGeoAddress());
- retValue.setCoordinate(m_coordinate);
- retValue.setBoundingBox(m_boundingBox);
- return retValue;
-}
-
-/*!
- \qmlproperty Address QtLocation5::Location::address
-
- This property holds the address of the location which can be use to retrieve address details of the location.
-*/
-void QDeclarativeGeoLocation::setAddress(QDeclarativeGeoAddress *address)
-{
- if (m_address == address)
- return;
-
- if (m_address && m_address->parent() == this)
- delete m_address;
-
- m_address = address;
- emit addressChanged();
-}
-
-QDeclarativeGeoAddress *QDeclarativeGeoLocation::address() const
-{
- return m_address;
-}
-
-/*!
- \qmlproperty coordinate QtLocation5::Location::coordinate
-
- This property holds the exact geographical coordinate of the location which can be used to retrieve the latitude, longitude and altitude of the location.
-
- \note this property's changed() signal is currently emitted only if the
- whole object changes, not if only the contents of the object change.
-*/
-void QDeclarativeGeoLocation::setCoordinate(const QGeoCoordinate coordinate)
-{
- if (m_coordinate == coordinate)
- return;
-
- m_coordinate = coordinate;
- emit coordinateChanged();
-}
-
-QGeoCoordinate QDeclarativeGeoLocation::coordinate() const
-{
- return m_coordinate;
-}
-
-/*!
- \qmlproperty GeoRectangle QtLocation5::Location::boundingBox
-
- This property holds the recommended region to use when displaying the location.
- For example, a building's location may have a region centered around the building,
- but the region is large enough to show it's immediate surrounding geographical
- context.
-
- Note: this property's changed() signal is currently emitted only if the
- whole object changes, not if only the contents of the object change.
-*/
-void QDeclarativeGeoLocation::setBoundingBox(const QGeoRectangle &boundingBox)
-{
- if (m_boundingBox == boundingBox)
- return;
-
- m_boundingBox = boundingBox;
- emit boundingBoxChanged();
-}
-
-QGeoRectangle QDeclarativeGeoLocation::boundingBox() const
-{
- return m_boundingBox;
-}
diff --git a/src/imports/location/qdeclarativegeolocation_p.h b/src/imports/location/qdeclarativegeolocation_p.h
deleted file mode 100644
index 4435eeec..00000000
--- a/src/imports/location/qdeclarativegeolocation_p.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEGEOLOCATION_P_H
-#define QDECLARATIVEGEOLOCATION_P_H
-
-#include "qdeclarativegeoaddress_p.h"
-
-#include <QtCore/QObject>
-#include <QtQml/QQmlListProperty>
-#include <QtLocation/QGeoLocation>
-#include <QtLocation/QGeoRectangle>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeGeoLocation : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(QGeoLocation location READ location WRITE setLocation)
- Q_PROPERTY(QDeclarativeGeoAddress *address READ address WRITE setAddress NOTIFY addressChanged)
- Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged)
- Q_PROPERTY(QGeoRectangle boundingBox READ boundingBox WRITE setBoundingBox NOTIFY boundingBoxChanged)
-
-public:
- explicit QDeclarativeGeoLocation(QObject *parent = 0);
- explicit QDeclarativeGeoLocation(const QGeoLocation &src, QObject *parent = 0);
- ~QDeclarativeGeoLocation();
-
- QGeoLocation location() const;
- void setLocation(const QGeoLocation &src);
-
- QDeclarativeGeoAddress *address() const;
- void setAddress(QDeclarativeGeoAddress *address);
- QGeoCoordinate coordinate() const;
- void setCoordinate(const QGeoCoordinate coordinate);
-
- QGeoRectangle boundingBox() const;
- void setBoundingBox(const QGeoRectangle &boundingBox);
-
-Q_SIGNALS:
- void addressChanged();
- void coordinateChanged();
- void boundingBoxChanged();
-
-private:
- QDeclarativeGeoAddress *m_address;
- QGeoRectangle m_boundingBox;
- QGeoCoordinate m_coordinate;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeGeoLocation)
-
-#endif // QDECLARATIVELOCATION_P_H
diff --git a/src/imports/location/qdeclarativegeomaneuver_p.h b/src/imports/location/qdeclarativegeomaneuver_p.h
index e03f9b81..f81124fa 100644
--- a/src/imports/location/qdeclarativegeomaneuver_p.h
+++ b/src/imports/location/qdeclarativegeomaneuver_p.h
@@ -44,7 +44,7 @@
#include <qgeomaneuver.h>
-#include "qdeclarativecoordinate_p.h"
+#include <QtPositioning/QGeoCoordinate>
#include <QObject>
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp
index 2283e22a..2b860eb3 100644
--- a/src/imports/location/qdeclarativegeomap.cpp
+++ b/src/imports/location/qdeclarativegeomap.cpp
@@ -45,7 +45,6 @@
#include "qdeclarativecirclemapitem_p.h"
#include "qdeclarativegeomapquickitem_p.h"
-#include "qdeclarativecoordinate_p.h"
#include "qdeclarativegeoserviceprovider_p.h"
#include <QtCore/QCoreApplication>
#include <QtCore/qnumeric.h>
diff --git a/src/imports/location/qdeclarativegeomapgesturearea.cpp b/src/imports/location/qdeclarativegeomapgesturearea.cpp
index 22eeba07..e75b41f1 100644
--- a/src/imports/location/qdeclarativegeomapgesturearea.cpp
+++ b/src/imports/location/qdeclarativegeomapgesturearea.cpp
@@ -41,7 +41,6 @@
#include "qdeclarativegeomapgesturearea_p.h"
#include "qdeclarativegeomap_p.h"
-#include "qdeclarativecoordinate_p.h"
#include "error_messages.h"
#include <QtGui/QGuiApplication>
diff --git a/src/imports/location/qdeclarativegeomapitembase_p.h b/src/imports/location/qdeclarativegeomapitembase_p.h
index 2cb482d4..78424124 100644
--- a/src/imports/location/qdeclarativegeomapitembase_p.h
+++ b/src/imports/location/qdeclarativegeomapitembase_p.h
@@ -45,7 +45,6 @@
#include <QtQuick/QQuickItem>
#include "qdeclarativegeomap_p.h"
-#include "qdeclarativecoordinate_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeomapmousearea_p.h b/src/imports/location/qdeclarativegeomapmousearea_p.h
index 7a23ea2f..3c89ef0b 100644
--- a/src/imports/location/qdeclarativegeomapmousearea_p.h
+++ b/src/imports/location/qdeclarativegeomapmousearea_p.h
@@ -42,7 +42,6 @@
#ifndef QDECLARATIVEGEOMAPMOUSEAREA_H
#define QDECLARATIVEGEOMAPMOUSEAREA_H
-#include "qdeclarativecoordinate_p.h"
#include "qdeclarativegeomap_p.h"
#include "qdeclarativegeomapmouseevent_p.h"
diff --git a/src/imports/location/qdeclarativegeomapmouseevent_p.h b/src/imports/location/qdeclarativegeomapmouseevent_p.h
index 0529419f..34341d07 100644
--- a/src/imports/location/qdeclarativegeomapmouseevent_p.h
+++ b/src/imports/location/qdeclarativegeomapmouseevent_p.h
@@ -42,7 +42,7 @@
#ifndef QDECLARATIVEGEOMAPMOUSEEVENT_H
#define QDECLARATIVEGEOMAPMOUSEEVENT_H
-#include "qdeclarativecoordinate_p.h"
+#include <QtPositioning/QGeoCoordinate>
#include <QtQml/qqml.h>
diff --git a/src/imports/location/qdeclarativegeomapquickitem.cpp b/src/imports/location/qdeclarativegeomapquickitem.cpp
index 8a9b0c6e..3db74289 100644
--- a/src/imports/location/qdeclarativegeomapquickitem.cpp
+++ b/src/imports/location/qdeclarativegeomapquickitem.cpp
@@ -41,7 +41,6 @@
#include "qdeclarativegeomapquickitem_p.h"
#include "qdeclarativegeomapmousearea_p.h"
-#include "qdeclarativecoordinate_p.h"
#include <QtQml/qqmlinfo.h>
#include <QtQuick/QSGOpacityNode>
diff --git a/src/imports/location/qdeclarativegeomapquickitem_p.h b/src/imports/location/qdeclarativegeomapquickitem_p.h
index c67dd170..1ed658d9 100644
--- a/src/imports/location/qdeclarativegeomapquickitem_p.h
+++ b/src/imports/location/qdeclarativegeomapquickitem_p.h
@@ -46,7 +46,6 @@
#include <QtQuick/QSGNode>
#include "qdeclarativegeomap_p.h"
-#include "qdeclarativecoordinate_p.h"
#include "qdeclarativegeomapitembase_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeoroute.cpp b/src/imports/location/qdeclarativegeoroute.cpp
index 87c49e1f..3430a2b9 100644
--- a/src/imports/location/qdeclarativegeoroute.cpp
+++ b/src/imports/location/qdeclarativegeoroute.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include "qdeclarativegeoroute_p.h"
-#include "locationvaluetypeprovider.h"
+#include "locationvaluetypehelper_p.h"
#include <private/qjsvalue_p.h>
#include <private/qqmlvaluetypewrapper_p.h>
@@ -48,7 +48,7 @@
#include <QtQml/QQmlContext>
#include <QtQml/qqmlinfo.h>
#include <QtQml/private/qqmlengine_p.h>
-#include <QtLocation/QGeoRectangle>
+#include <QtPositioning/QGeoRectangle>
QT_BEGIN_NAMESPACE
@@ -114,7 +114,7 @@ QList<QGeoCoordinate> QDeclarativeGeoRoute::routePath()
}
/*!
- \qmlproperty GeoRectangle QtLocation5::Route::bounds
+ \qmlproperty georectangle QtLocation5::Route::bounds
Read-only property which holds a bounding box which encompasses the entire route.
@@ -160,7 +160,7 @@ qreal QDeclarativeGeoRoute::distance() const
indicates the number of objects and 'path[index starting from zero]' gives
the actual object.
- \sa QtLocation::coordinate
+ \sa QtPositioning::coordinate
*/
QJSValue QDeclarativeGeoRoute::path() const
diff --git a/src/imports/location/qdeclarativegeoroute_p.h b/src/imports/location/qdeclarativegeoroute_p.h
index 8ea0e078..d9b9e718 100644
--- a/src/imports/location/qdeclarativegeoroute_p.h
+++ b/src/imports/location/qdeclarativegeoroute_p.h
@@ -45,6 +45,7 @@
#include "qdeclarativegeoroutesegment_p.h"
#include <QtCore/QObject>
+#include <QtQml/QQmlListProperty>
#include <QtQml/private/qv8engine_p.h>
#include <QtLocation/QGeoRoute>
diff --git a/src/imports/location/qdeclarativegeoroutemodel.cpp b/src/imports/location/qdeclarativegeoroutemodel.cpp
index 8afac048..9ace5174 100644
--- a/src/imports/location/qdeclarativegeoroutemodel.cpp
+++ b/src/imports/location/qdeclarativegeoroutemodel.cpp
@@ -42,7 +42,7 @@
#include "qdeclarativegeoroutemodel_p.h"
#include "qdeclarativegeoroute_p.h"
#include "error_messages.h"
-#include "locationvaluetypeprovider.h"
+#include "locationvaluetypehelper_p.h"
#include <private/qqmlvaluetypewrapper_p.h>
#include <private/qjsvalue_p.h>
@@ -52,7 +52,7 @@
#include <QtQml/qqmlinfo.h>
#include <QtQml/private/qqmlengine_p.h>
#include <QtLocation/QGeoRoutingManager>
-#include <QtLocation/QGeoRectangle>
+#include <QtPositioning/QGeoRectangle>
QT_BEGIN_NAMESPACE
@@ -777,7 +777,7 @@ void QDeclarativeGeoRouteQuery::setWaypoints(const QJSValue &value)
}
/*!
- \qmlproperty QQmlListProperty<GeoRectangle> RouteQuery::excludedAreas
+ \qmlproperty list<georectangle> RouteQuery::excludedAreas
Areas that the route must not cross.
@@ -835,7 +835,7 @@ void QDeclarativeGeoRouteQuery::setExcludedAreas(const QJSValue &value)
}
/*!
- \qmlmethod QtLocation5::RouteQuery::addExcludedArea(GeoRectangle)
+ \qmlmethod QtLocation5::RouteQuery::addExcludedArea(georectangle)
Adds the given area to excluded areas (areas that the route must not cross).
Same area can only be added once.
@@ -865,7 +865,7 @@ void QDeclarativeGeoRouteQuery::addExcludedArea(const QGeoRectangle &area)
}
/*!
- \qmlmethod QtLocation5::RouteQuery::removeExcludedArea(GeoRectangle)
+ \qmlmethod QtLocation5::RouteQuery::removeExcludedArea(georectangle)
Removes the given area to excluded areas (areas that the route must not cross).
@@ -1086,10 +1086,9 @@ void QDeclarativeGeoRouteQuery::setTravelModes(QDeclarativeGeoRouteQuery::Travel
/*!
- \qmlproperty SegmentDetail RouteQuery::segmentDetail
+ \qmlproperty enumeration RouteQuery::segmentDetail
The level of detail which will be used in the representation of routing segments.
- Values can be combined with OR ('|') -operator.
\list
\li RouteQuery.NoSegmentData - No segment data should be included with the route
@@ -1116,10 +1115,9 @@ QDeclarativeGeoRouteQuery::SegmentDetail QDeclarativeGeoRouteQuery::segmentDetai
}
/*!
- \qmlproperty ManeuverDetail RouteQuery::maneuverDetail
+ \qmlproperty enumeration RouteQuery::maneuverDetail
The level of detail which will be used in the representation of routing maneuvers.
- Values can be combined with OR ('|') -operator.
\list
\li RouteQuery.NoManeuvers - No maneuvers should be included with the route
@@ -1182,7 +1180,7 @@ QDeclarativeGeoRouteQuery::TravelModes QDeclarativeGeoRouteQuery::travelModes()
}
/*!
- \qmlproperty RouteOptimizations RouteQuery::routeOptimizations
+ \qmlproperty enumeration RouteQuery::routeOptimizations
The route optimizations which should be considered during the planning of the route.
Values can be combined with OR ('|') -operator.
diff --git a/src/imports/location/qdeclarativegeoroutemodel_p.h b/src/imports/location/qdeclarativegeoroutemodel_p.h
index bf3984d5..0d663eed 100644
--- a/src/imports/location/qdeclarativegeoroutemodel_p.h
+++ b/src/imports/location/qdeclarativegeoroutemodel_p.h
@@ -44,8 +44,8 @@
#include "qdeclarativegeoserviceprovider_p.h"
-#include "qdeclarativecoordinate_p.h"
-#include "qdeclarativegeorectangle.h"
+#include <QtPositioning/QGeoCoordinate>
+#include <QtPositioning/QGeoRectangle>
#include <qgeorouterequest.h>
#include <qgeoroutereply.h>
diff --git a/src/imports/location/qdeclarativegeoroutesegment.cpp b/src/imports/location/qdeclarativegeoroutesegment.cpp
index 8199f9ec..3dbe06f8 100644
--- a/src/imports/location/qdeclarativegeoroutesegment.cpp
+++ b/src/imports/location/qdeclarativegeoroutesegment.cpp
@@ -146,7 +146,7 @@ QDeclarativeGeoManeuver *QDeclarativeGeoRouteSegment::maneuver() const
indicates the number of objects and 'path[index starting from zero]' gives
the actual object.
- \sa QtLocation::coordinate
+ \sa QtPositioning::coordinate
*/
QJSValue QDeclarativeGeoRouteSegment::path() const
diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp
index 6eedb2c7..c10fe03a 100644
--- a/src/imports/location/qdeclarativepolygonmapitem.cpp
+++ b/src/imports/location/qdeclarativepolygonmapitem.cpp
@@ -43,7 +43,7 @@
#include "qgeocameracapabilities_p.h"
#include "qlocationutils_p.h"
#include "error_messages.h"
-#include "locationvaluetypeprovider.h"
+#include "locationvaluetypehelper_p.h"
#include <QtGui/private/qtriangulator_p.h>
#include <QtQml/QQmlInfo>
@@ -71,10 +71,10 @@ QT_BEGIN_NAMESPACE
\brief The MapPolygon type displays a polygon on a Map
The MapPolygon type displays a polygon on a Map, specified in terms of an ordered list of
- \l {QtLocation::coordinate}{coordinates}. For best appearance and results, polygons should be
+ \l {QtPositioning::coordinate}{coordinates}. For best appearance and results, polygons should be
simple (not self-intersecting).
- The \l {QtLocation::coordinate}{coordinates} on the path cannot be directly changed after
+ The \l {QtPositioning::coordinate}{coordinates} on the path cannot be directly changed after
being added to the Polygon. Instead, copy the \l path into a var, modify the copy and reassign
the copy back to the \l path.
@@ -344,10 +344,13 @@ QDeclarativePolygonMapItem::~QDeclarativePolygonMapItem()
}
/*!
+ \qmlpropertygroup Location::MapPolygon::border
\qmlproperty int MapPolygon::border.width
\qmlproperty color MapPolygon::border.color
- These properties hold the width and color used to draw the border of the circle.
+ This property is part of the border property group. The border property
+ group holds the width and color used to draw the border of the circle.
+
The width is in pixels and is independent of the zoom level of the map.
The default values correspond to a black border with a width of 1 pixel.
diff --git a/src/imports/location/qdeclarativepolylinemapitem.cpp b/src/imports/location/qdeclarativepolylinemapitem.cpp
index abdf9d53..144f55ec 100644
--- a/src/imports/location/qdeclarativepolylinemapitem.cpp
+++ b/src/imports/location/qdeclarativepolylinemapitem.cpp
@@ -43,7 +43,7 @@
#include "qgeocameracapabilities_p.h"
#include "qlocationutils_p.h"
#include "error_messages.h"
-#include "locationvaluetypeprovider.h"
+#include "locationvaluetypehelper_p.h"
#include <QtQml/QQmlInfo>
#include <QtQml/QQmlContext>
@@ -590,10 +590,12 @@ void QDeclarativePolylineMapItem::removeCoordinate(const QGeoCoordinate &coordin
}
/*!
+ \qmlpropertygroup Location::MapPolyline::line
\qmlproperty int MapPolyline::line.width
\qmlproperty color MapPolyline::line.color
- These properties hold the width and color used to draw the line.
+ This property is part of the line property group. The line
+ property group holds the width and color used to draw the line.
The width is in pixels and is independent of the zoom level of the map.
The default values correspond to a black border with a width of 1 pixel.
diff --git a/src/imports/location/qdeclarativerectanglemapitem.cpp b/src/imports/location/qdeclarativerectanglemapitem.cpp
index ffb0a2c3..8573ec51 100644
--- a/src/imports/location/qdeclarativerectanglemapitem.cpp
+++ b/src/imports/location/qdeclarativerectanglemapitem.cpp
@@ -205,10 +205,12 @@ void QDeclarativeRectangleMapItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap
}
/*!
+ \qmlpropertygroup Location::MapRectangle::border
\qmlproperty int MapRectangle::border.width
\qmlproperty color MapRectangle::border.color
- These properties hold the width and color used to draw the border of the rectangle.
+ This property is part of the border property group. The border property group
+ holds the width and color used to draw the border of the rectangle.
The width is in pixels and is independent of the zoom level of the map.
The default values correspond to a black border with a width of 1 pixel.
diff --git a/src/imports/location/qdeclarativeroutemapitem.cpp b/src/imports/location/qdeclarativeroutemapitem.cpp
index 264ee835..1af8e120 100644
--- a/src/imports/location/qdeclarativeroutemapitem.cpp
+++ b/src/imports/location/qdeclarativeroutemapitem.cpp
@@ -173,10 +173,12 @@ QSGNode *QDeclarativeRouteMapItem::updateMapItemPaintNode(QSGNode *oldNode, Upda
}
/*!
+ \qmlpropertygroup Location::MapRoute::line
\qmlproperty int MapRoute::line.width
\qmlproperty color MapRoute::line.color
- These properties hold the width and color used to draw the line.
+ This property is part of the line property group.
+ The line property group holds the width and color used to draw the line.
The width is in pixels and is independent of the zoom level of the map.
The default values correspond to a black border with a width of 1 pixel.
diff --git a/src/imports/location/qdeclarativeroutemapitem_p.h b/src/imports/location/qdeclarativeroutemapitem_p.h
index 099b333f..479a621d 100644
--- a/src/imports/location/qdeclarativeroutemapitem_p.h
+++ b/src/imports/location/qdeclarativeroutemapitem_p.h
@@ -43,7 +43,6 @@
#define QDECLARATIVEROUTEMAPITEM_H_
#include "qdeclarativegeomapitembase_p.h"
-#include "qdeclarativecoordinate_p.h"
#include "qdeclarativegeomap_p.h"
#include "qdeclarativepolylinemapitem_p.h"
#include <QPen>
diff --git a/src/imports/positioning/error_messages.cpp b/src/imports/positioning/error_messages.cpp
new file mode 100644
index 00000000..45b85e0a
--- /dev/null
+++ b/src/imports/positioning/error_messages.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtPositioning module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "error_messages.h"
+
+QT_BEGIN_NAMESPACE
+
+const char CONTEXT_NAME[] = "QtPositioningQML";
+const char MISSED_NMEA_FILE[] = QT_TRANSLATE_NOOP("QtPositioningQML", "Nmea file not found.");
+
+QT_END_NAMESPACE
diff --git a/src/imports/positioning/error_messages.h b/src/imports/positioning/error_messages.h
new file mode 100644
index 00000000..3c888dff
--- /dev/null
+++ b/src/imports/positioning/error_messages.h
@@ -0,0 +1,54 @@
+
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtPositioning module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef ERROR_MESSAGES_H
+#define ERROR_MESSAGES_H
+
+#include <QString>
+
+QT_BEGIN_NAMESPACE
+
+extern const char CONTEXT_NAME[];
+extern const char MISSED_NMEA_FILE[];
+
+QT_END_NAMESPACE
+
+#endif // ERROR_MESSAGES_H
diff --git a/src/imports/location/locationsingleton.cpp b/src/imports/positioning/locationsingleton.cpp
index e4f9a833..c44db946 100644
--- a/src/imports/location/locationsingleton.cpp
+++ b/src/imports/positioning/locationsingleton.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -42,19 +42,18 @@
#include "locationsingleton.h"
/*!
- \qmltype QtLocation
+ \qmltype QtPositioning
\instantiates LocationSingleton
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-common
+ \inqmlmodule QtPositioning 5.0
- \brief The QtLocation global object provides useful functions for working with Qt Location
+ \brief The QtPositioning global object provides useful functions for working with location-based
types in QML.
\qml
- import QtLocation 5.0
+ import QtPositioning 5.0
Item {
- property variant coordinate: QtLocation.coordinate(-27.5, 153.1)
+ property variant coordinate: QtPositioning.coordinate(-27.5, 153.1)
}
\endqml
*/
@@ -65,7 +64,7 @@ LocationSingleton::LocationSingleton(QObject *parent)
}
/*!
- \qmlmethod coordinate QtLocation5::QtLocation::coordinate()
+ \qmlmethod coordinate ::QtPositioning::coordinate()
Constructs an invalid coordinate.
@@ -76,7 +75,7 @@ QGeoCoordinate LocationSingleton::coordinate() const
}
/*!
- \qmlmethod coordinate QtLocation5::QtLocation::coordinate(real latitude, real longitue, real altitude) const
+ \qmlmethod coordinate QtPositioning::coordinate(real latitude, real longitue, real altitude) const
Constructs a coordinate with the specified \a latitude, \a longitude and optional \a altitude.
Both \a latitude and \a longitude must be valid, otherwise an invalid coordinate is returned.
@@ -89,7 +88,7 @@ QGeoCoordinate LocationSingleton::coordinate(double latitude, double longitude,
}
/*!
- \qmlmethod geoshape QtLocation5::QtLocation::shape() const
+ \qmlmethod geoshape QtPositioning::shape() const
Constructs an invalid geoshape.
@@ -101,7 +100,7 @@ QGeoShape LocationSingleton::shape() const
}
/*!
- \qmlmethod georectangle QtLocation5::QtLocation::rectangle() const
+ \qmlmethod georectangle QtPositioning::rectangle() const
Constructs an invalid georectangle.
@@ -113,7 +112,7 @@ QGeoRectangle LocationSingleton::rectangle() const
}
/*!
- \qmlmethod georectangle QtLocation5::QtLocation::rectangle(coordinate center, real width, real height) const
+ \qmlmethod georectangle QtPositioning::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.
@@ -127,7 +126,7 @@ QGeoRectangle LocationSingleton::rectangle(const QGeoCoordinate &center,
}
/*!
- \qmlmethod georectangle QtLocation5::QtLocation::rectangle(coordinate topLeft, coordinate bottomRight) const
+ \qmlmethod georectangle QtPositioning::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}.
@@ -141,7 +140,7 @@ QGeoRectangle LocationSingleton::rectangle(const QGeoCoordinate &topLeft,
}
/*!
- \qmlmethod geocircle QtLocation5::QtLocation::circle() const
+ \qmlmethod geocircle QtPositioning::circle() const
Constructs an invalid geocircle.
@@ -153,7 +152,7 @@ QGeoCircle LocationSingleton::circle() const
}
/*!
- \qmlmethod geocircle QtLocation5::QtLocation::circle(coordinate center, real radius) const
+ \qmlmethod geocircle QtPositioning::circle(coordinate center, real radius) const
Constructs a geocircle centered at \a center with a radius of \a radius meters.
*/
diff --git a/src/imports/location/locationsingleton.h b/src/imports/positioning/locationsingleton.h
index b3839ba5..b5e6476e 100644
--- a/src/imports/location/locationsingleton.h
+++ b/src/imports/positioning/locationsingleton.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -44,10 +44,10 @@
#include <QtCore/QObject>
#include <QtCore/qnumeric.h>
-#include <QtLocation/QGeoCoordinate>
-#include <QtLocation/QGeoShape>
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCircle>
+#include <QtPositioning/QGeoCoordinate>
+#include <QtPositioning/QGeoShape>
+#include <QtPositioning/QGeoRectangle>
+#include <QtPositioning/QGeoCircle>
class LocationSingleton : public QObject
{
diff --git a/src/imports/location/locationvaluetypeprovider.cpp b/src/imports/positioning/locationvaluetypeprovider.cpp
index 0477e72a..9ee93dbe 100644
--- a/src/imports/location/locationvaluetypeprovider.cpp
+++ b/src/imports/positioning/locationvaluetypeprovider.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -44,90 +44,11 @@
#include "qdeclarativegeoshape.h"
#include "qdeclarativegeorectangle.h"
#include "qdeclarativegeocircle.h"
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCircle>
+#include <QtPositioning/QGeoRectangle>
+#include <QtPositioning/QGeoCircle>
QT_BEGIN_NAMESPACE
-QGeoCoordinate parseCoordinate(const QJSValue &value, bool *ok)
-{
- QGeoCoordinate c;
-
- if (value.isObject()) {
- if (value.hasProperty(QStringLiteral("latitude")))
- c.setLatitude(value.property(QStringLiteral("latitude")).toNumber());
- if (value.hasProperty(QStringLiteral("longitude")))
- c.setLongitude(value.property(QStringLiteral("longitude")).toNumber());
- if (value.hasProperty(QStringLiteral("altitude")))
- c.setAltitude(value.property(QStringLiteral("altitude")).toNumber());
-
- if (ok)
- *ok = true;
- }
-
- return c;
-}
-
-QGeoRectangle parseRectangle(const QJSValue &value, bool *ok)
-{
- QGeoRectangle r;
-
- *ok = false;
-
- if (value.isObject()) {
- if (value.hasProperty(QStringLiteral("bottomLeft"))) {
- QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("bottomLeft")), ok);
- if (*ok)
- r.setBottomLeft(c);
- }
- if (value.hasProperty(QStringLiteral("bottomRight"))) {
- QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("bottomRight")), ok);
- if (*ok)
- r.setBottomRight(c);
- }
- if (value.hasProperty(QStringLiteral("topLeft"))) {
- QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("topLeft")), ok);
- if (*ok)
- r.setTopLeft(c);
- }
- if (value.hasProperty(QStringLiteral("topRight"))) {
- QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("topRight")), ok);
- if (*ok)
- r.setTopRight(c);
- }
- if (value.hasProperty(QStringLiteral("center"))) {
- QGeoCoordinate c = parseCoordinate(value.property(QStringLiteral("center")), ok);
- if (*ok)
- r.setCenter(c);
- }
- if (value.hasProperty(QStringLiteral("height")))
- r.setHeight(value.property(QStringLiteral("height")).toNumber());
- if (value.hasProperty(QStringLiteral("width")))
- r.setWidth(value.property(QStringLiteral("width")).toNumber());
- }
-
- return r;
-}
-
-QGeoCircle parseCircle(const QJSValue &value, bool *ok)
-{
- QGeoCircle c;
-
- *ok = false;
-
- if (value.isObject()) {
- if (value.hasProperty(QStringLiteral("center"))) {
- QGeoCoordinate coord = parseCoordinate(value.property(QStringLiteral("center")), ok);
- if (*ok)
- c.setCenter(coord);
- }
- if (value.hasProperty(QStringLiteral("radius")))
- c.setRadius(value.property(QStringLiteral("radius")).toNumber());
- }
-
- return c;
-}
-
LocationValueTypeProvider::LocationValueTypeProvider()
: QQmlValueTypeProvider()
{
diff --git a/src/imports/location/locationvaluetypeprovider.h b/src/imports/positioning/locationvaluetypeprovider.h
index 2d204aa5..b60d2c99 100644
--- a/src/imports/location/locationvaluetypeprovider.h
+++ b/src/imports/positioning/locationvaluetypeprovider.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -46,14 +46,6 @@
QT_BEGIN_NAMESPACE
-class QGeoCoordinate;
-class QGeoRectangle;
-class QGeoCircle;
-
-QGeoCoordinate parseCoordinate(const QJSValue &value, bool *ok);
-QGeoRectangle parseRectangle(const QJSValue &value, bool *ok);
-QGeoCircle parseCircle(const QJSValue &value, bool *ok);
-
class LocationValueTypeProvider : public QQmlValueTypeProvider
{
public:
diff --git a/src/imports/positioning/plugin.json b/src/imports/positioning/plugin.json
new file mode 100644
index 00000000..2c63c085
--- /dev/null
+++ b/src/imports/positioning/plugin.json
@@ -0,0 +1,2 @@
+{
+}
diff --git a/src/imports/positioning/plugins.qmltypes b/src/imports/positioning/plugins.qmltypes
new file mode 100644
index 00000000..3f5b1ff7
--- /dev/null
+++ b/src/imports/positioning/plugins.qmltypes
@@ -0,0 +1,167 @@
+import QtQuick.tooling 1.1
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated with the command 'qmlplugindump -notrelocatable QtPositioning 5.0'.
+
+Module {
+ Component {
+ name: "GeoShapeValueType"
+ prototype: "QQmlValueType"
+ exports: ["QtPositioning/GeoShape 5.0"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "ShapeType"
+ values: {
+ "UnknownType": 0,
+ "RectangleType": 1,
+ "CircleType": 2
+ }
+ }
+ Property { name: "type"; type: "ShapeType"; isReadonly: true }
+ Property { name: "isValid"; type: "bool"; isReadonly: true }
+ Property { name: "isEmpty"; type: "bool"; isReadonly: true }
+ Method {
+ name: "contains"
+ type: "bool"
+ Parameter { name: "coordinate"; type: "QGeoCoordinate" }
+ }
+ }
+ Component {
+ name: "LocationSingleton"
+ prototype: "QObject"
+ exports: ["QtPositioning/QtPositioning 5.0"]
+ exportMetaObjectRevisions: [0]
+ Method { name: "coordinate"; type: "QGeoCoordinate" }
+ Method {
+ name: "coordinate"
+ type: "QGeoCoordinate"
+ Parameter { name: "latitude"; type: "double" }
+ Parameter { name: "longitude"; type: "double" }
+ Parameter { name: "altitude"; type: "double" }
+ }
+ Method {
+ name: "coordinate"
+ type: "QGeoCoordinate"
+ Parameter { name: "latitude"; type: "double" }
+ Parameter { name: "longitude"; type: "double" }
+ }
+ Method { name: "shape"; type: "QGeoShape" }
+ Method { name: "rectangle"; type: "QGeoRectangle" }
+ Method {
+ name: "rectangle"
+ type: "QGeoRectangle"
+ Parameter { name: "center"; type: "QGeoCoordinate" }
+ Parameter { name: "width"; type: "double" }
+ Parameter { name: "height"; type: "double" }
+ }
+ Method {
+ name: "rectangle"
+ type: "QGeoRectangle"
+ Parameter { name: "topLeft"; type: "QGeoCoordinate" }
+ Parameter { name: "bottomRight"; type: "QGeoCoordinate" }
+ }
+ Method { name: "circle"; type: "QGeoCircle" }
+ Method {
+ name: "circle"
+ type: "QGeoCircle"
+ Parameter { name: "center"; type: "QGeoCoordinate" }
+ Parameter { name: "radius"; type: "double" }
+ }
+ Method {
+ name: "circle"
+ type: "QGeoCircle"
+ Parameter { name: "center"; type: "QGeoCoordinate" }
+ }
+ }
+ Component {
+ name: "QDeclarativeGeoAddress"
+ prototype: "QObject"
+ exports: ["QtPositioning/Address 5.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "address"; type: "QGeoAddress" }
+ Property { name: "text"; type: "string" }
+ Property { name: "country"; type: "string" }
+ Property { name: "countryCode"; type: "string" }
+ Property { name: "state"; type: "string" }
+ Property { name: "county"; type: "string" }
+ Property { name: "city"; type: "string" }
+ Property { name: "district"; type: "string" }
+ Property { name: "street"; type: "string" }
+ Property { name: "postalCode"; type: "string" }
+ Property { name: "isTextGenerated"; type: "bool"; isReadonly: true }
+ }
+ Component {
+ name: "QDeclarativeGeoLocation"
+ prototype: "QObject"
+ exports: ["QtPositioning/Location 5.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "location"; type: "QGeoLocation" }
+ Property { name: "address"; type: "QDeclarativeGeoAddress"; isPointer: true }
+ Property { name: "coordinate"; type: "QGeoCoordinate" }
+ Property { name: "boundingBox"; type: "QGeoRectangle" }
+ }
+ Component {
+ name: "QDeclarativePosition"
+ prototype: "QObject"
+ exports: ["QtPositioning/Position 5.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "latitudeValid"; type: "bool"; isReadonly: true }
+ Property { name: "longitudeValid"; type: "bool"; isReadonly: true }
+ Property { name: "altitudeValid"; type: "bool"; isReadonly: true }
+ Property { name: "coordinate"; type: "QGeoCoordinate"; isReadonly: true }
+ Property { name: "timestamp"; type: "QDateTime"; isReadonly: true }
+ Property { name: "speed"; type: "double"; isReadonly: true }
+ Property { name: "speedValid"; type: "bool"; isReadonly: true }
+ Property { name: "horizontalAccuracy"; type: "double" }
+ Property { name: "verticalAccuracy"; type: "double" }
+ Property { name: "horizontalAccuracyValid"; type: "bool"; isReadonly: true }
+ Property { name: "verticalAccuracyValid"; type: "bool"; isReadonly: true }
+ }
+ Component {
+ name: "QDeclarativePositionSource"
+ prototype: "QObject"
+ exports: ["QtPositioning/PositionSource 5.0"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "PositioningMethod"
+ values: {
+ "NoPositioningMethod": 0,
+ "SatellitePositioningMethod": 255,
+ "NonSatellitePositioningMethod": -256,
+ "AllPositioningMethods": -1
+ }
+ }
+ Enum {
+ name: "PositioningMethods"
+ values: {
+ "NoPositioningMethod": 0,
+ "SatellitePositioningMethod": 255,
+ "NonSatellitePositioningMethod": -256,
+ "AllPositioningMethods": -1
+ }
+ }
+ Enum {
+ name: "SourceError"
+ values: {
+ "AccessError": 0,
+ "ClosedError": 1,
+ "UnknownSourceError": -1
+ }
+ }
+ Property { name: "position"; type: "QDeclarativePosition"; isReadonly: true; isPointer: true }
+ Property { name: "active"; type: "bool" }
+ Property { name: "valid"; type: "bool"; isReadonly: true }
+ Property { name: "nmeaSource"; type: "QUrl" }
+ Property { name: "updateInterval"; type: "int" }
+ Property { name: "supportedPositioningMethods"; type: "PositioningMethods"; isReadonly: true }
+ Property { name: "preferredPositioningMethods"; type: "PositioningMethods" }
+ Property { name: "sourceError"; type: "SourceError"; isReadonly: true }
+ Property { name: "name"; type: "string" }
+ Signal { name: "validityChanged" }
+ Method { name: "update" }
+ Method { name: "start" }
+ Method { name: "stop" }
+ }
+}
diff --git a/src/imports/positioning/positioning.cpp b/src/imports/positioning/positioning.cpp
new file mode 100644
index 00000000..031b06b2
--- /dev/null
+++ b/src/imports/positioning/positioning.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtPositioning module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "locationvaluetypeprovider.h"
+
+#include <QtPositioning/private/qdeclarativegeoaddress_p.h>
+#include <QtPositioning/private/qdeclarativegeolocation_p.h>
+
+#include "qdeclarativepositionsource_p.h"
+#include "qdeclarativeposition_p.h"
+
+#include "qdeclarativegeoshape.h"
+#include "qdeclarativegeorectangle.h"
+#include "qdeclarativegeocircle.h"
+#include "qdeclarativecoordinate_p.h"
+
+#include "locationsingleton.h"
+
+#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
+#include <QtQml/private/qqmlvaluetype_p.h>
+#include <QtQml/private/qqmlglobal_p.h>
+#include <QtQml/private/qqmlmetatype_p.h>
+
+#include <QtPositioning/QGeoRectangle>
+#include <QtPositioning/QGeoCircle>
+#include <QtPositioning/QGeoLocation>
+
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+static QObject *singleton_type_factory(QQmlEngine *engine, QJSEngine *jsEngine)
+{
+ Q_UNUSED(engine)
+ Q_UNUSED(jsEngine)
+
+ return new LocationSingleton;
+}
+
+static LocationValueTypeProvider *getValueTypeProvider()
+{
+ static LocationValueTypeProvider provider;
+ return &provider;
+}
+
+class QLocationDeclarativeModule: public QQmlExtensionPlugin
+{
+ Q_OBJECT
+
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0"
+ FILE "plugin.json")
+
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ if (QLatin1String(uri) == QLatin1String("QtPositioning")) {
+
+ // @uri QtPositioning 5.0
+
+ qmlRegisterSingletonType<LocationSingleton>(uri, 5, 0, "QtPositioning", singleton_type_factory);
+
+ QQml_addValueTypeProvider(getValueTypeProvider());
+ qmlRegisterValueTypeEnums<GeoShapeValueType>(uri, 5, 0, "GeoShape");
+
+ qmlRegisterType<QDeclarativePosition>(uri, 5, 0, "Position");
+ qmlRegisterType<QDeclarativePositionSource>(uri, 5, 0, "PositionSource");
+ qmlRegisterType<QDeclarativeGeoAddress>(uri, 5, 0, "Address");
+
+ qmlRegisterType<QDeclarativeGeoLocation>(uri, 5, 0, "Location");
+
+ qRegisterMetaType<QGeoCoordinate>("QGeoCoordinate");
+ qRegisterMetaType<QGeoAddress>("QGeoAddress");
+ qRegisterMetaType<QGeoRectangle>("QGeoRectangle");
+ qRegisterMetaType<QGeoCircle>("QGeoCircle");
+ qRegisterMetaType<QGeoLocation>("QGeoLocation");
+ } else {
+ qDebug() << "Unsupported URI given to load positioning QML plugin: " << QLatin1String(uri);
+ }
+ }
+};
+
+#include "positioning.moc"
+
+QT_END_NAMESPACE
diff --git a/src/imports/positioning/positioning.pro b/src/imports/positioning/positioning.pro
new file mode 100644
index 00000000..2d396463
--- /dev/null
+++ b/src/imports/positioning/positioning.pro
@@ -0,0 +1,32 @@
+QT += quick-private positioning-private qml-private core-private
+
+INCLUDEPATH *= $$PWD
+DEFINES += TOUCH_EVENT_WORKAROUND
+
+HEADERS += qdeclarativeposition_p.h \
+ qdeclarativepositionsource_p.h \
+ qdeclarativecoordinate_p.h \
+ qdeclarativegeoshape.h \
+ qdeclarativegeorectangle.h \
+ qdeclarativegeocircle.h \
+ locationvaluetypeprovider.h \
+ locationsingleton.h \
+ error_messages.h \
+ locationvaluetypehelper_p.h
+
+SOURCES += qdeclarativeposition.cpp \
+ positioning.cpp \
+ qdeclarativepositionsource.cpp \
+ qdeclarativecoordinate.cpp \
+ qdeclarativegeoshape.cpp \
+ qdeclarativegeorectangle.cpp \
+ qdeclarativegeocircle.cpp \
+ locationvaluetypeprovider.cpp \
+ locationsingleton.cpp \
+ error_messages.cpp
+
+load(qml_plugin)
+
+OTHER_FILES += \
+ plugin.json \
+ qmldir
diff --git a/src/imports/location/qdeclarativecoordinate.cpp b/src/imports/positioning/qdeclarativecoordinate.cpp
index f832d4f2..20dd5cef 100644
--- a/src/imports/location/qdeclarativecoordinate.cpp
+++ b/src/imports/positioning/qdeclarativecoordinate.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -45,22 +45,22 @@ QT_BEGIN_NAMESPACE
/*!
\qmlbasictype coordinate
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-basictypes
- \since Qt Location 5.0
+ \inqmlmodule QtPositioning 5.0
+ \ingroup qml-QtPositioning5-basictypes
+ \since Qt Positioning 5.0
\brief The coordinate type represents and stores a geographic position.
- The \c coordinate type represents a geographic position in the form of \c {latitude},
- \c longitude and \c altitude attributes. The \c latitude attribute specifies the number of
+ The \c coordinate type represents a geographic position in the form of \l {latitude},
+ \l longitude and \l altitude attributes. The \l latitude attribute specifies the number of
decimal degrees above and below the equator. A positive latitude indicates the Northern
- Hemisphere and a negative latitude indicates the Southern Hemisphere. The \c longitude
+ Hemisphere and a negative latitude indicates the Southern Hemisphere. The \l longitude
attribute specifies the number of decimal degrees east and west. A positive longitude
indicates the Eastern Hemisphere and a negative longitude indicates the Western Hemisphere.
- The \c altitude attribute specifies the number of meters above sea level. Together, these
+ The \l altitude attribute specifies the number of meters above sea level. Together, these
attributes specify a 3-dimensional position anywhere on or near the Earth's surface.
- The \c isValid attribute can be used to test if a coordinate is valid. A coordinate is
+ The \l isValid attribute can be used to test if a coordinate is valid. A coordinate is
considered valid if it has a valid latitude and longitude. A valid altitude is not required.
The latitude must be between -90 and 90 inclusive and the longitude must be between -180 and
180 inclusive.
@@ -81,19 +81,19 @@ QT_BEGIN_NAMESPACE
\section2 Example Usage
Use properties of type \l variant to store a \c {coordinate}. To create a \c coordinate use
- one of the methods described below. In all cases, specifying the \c altitude attribute is
+ one of the methods described below. In all cases, specifying the \l altitude attribute is
optional.
- To create a \c coordinate value, use the \l{QtLocation5::QtLocation}{QtLocation.coordinate()}
+ To create a \c coordinate value, use the \l{QtPositioning::coordinate}{QtPositioning.coordinate()}
function:
\qml
- import QtLocation 5.0
+ import QtPositioning 5.0
- Location { coordinate: QtLocation.coordinate(-27.5, 153.1) }
+ Location { coordinate: QtPositioning.coordinate(-27.5, 153.1) }
\endqml
- or as separate \c {latitude}, \c longitude and \c altitude components:
+ or as separate \l latitude, \l longitude and \l altitude components:
\qml
Location {
@@ -107,6 +107,55 @@ QT_BEGIN_NAMESPACE
When integrating with C++, note that any QGeoCoordinate value passed into QML from C++ is
automatically converted into a \c coordinate value, and vice-versa.
+ \section2 Properties
+
+ \section3 latitude
+
+ \code
+ real latitude
+ \endcode
+
+ This property holds latitude value of the geographical position
+ (decimal degrees). A positive latitude indicates the Northern Hemisphere,
+ and a negative latitude indicates the Southern Hemisphere.
+ If the property has not been set, its default value is NaN.
+
+ \section3 longitude
+
+ \code
+ real longitude
+ \endcode
+
+ This property holds the longitude value of the geographical position
+ (decimal degrees). A positive longitude indicates the Eastern Hemisphere,
+ and a negative longitude indicates the Western Hemisphere
+ If the property has not been set, its default value is NaN.
+
+ \section3 altitude
+
+ \code
+ real altitude
+ \endcode
+
+ This property holds the value of altitude (meters above sea level).
+ If the property has not been set, its default value is NaN.
+
+ \section3 isValid
+
+ \code
+ bool isValid
+ \endcode
+
+ This property holds the current validity of the coordinate. Coordinates
+ are considered valid if they have been set with a valid latitude and
+ longitude (altitude is not required).
+
+ The latitude must be between -90 to 90 inclusive to be considered valid,
+ and the longitude must be between -180 to 180 inclusive to be considered
+ valid.
+
+ This is a read-only property.
+
\section2 Methods
\section3 distanceTo()
diff --git a/src/imports/location/qdeclarativecoordinate_p.h b/src/imports/positioning/qdeclarativecoordinate_p.h
index 1e4e6dd5..8f7a47e5 100644
--- a/src/imports/location/qdeclarativecoordinate_p.h
+++ b/src/imports/positioning/qdeclarativecoordinate_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -43,7 +43,7 @@
#define QDECLARATIVECOORDINATE_H
#include <QtQml/private/qqmlvaluetype_p.h>
-#include <QtLocation/QGeoCoordinate>
+#include <QtPositioning/QGeoCoordinate>
QT_BEGIN_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeocircle.cpp b/src/imports/positioning/qdeclarativegeocircle.cpp
index cfa533a9..4424d2d7 100644
--- a/src/imports/location/qdeclarativegeocircle.cpp
+++ b/src/imports/positioning/qdeclarativegeocircle.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -42,7 +42,7 @@
#include "qdeclarativegeocircle.h"
#include <QtCore/qnumeric.h>
-#include <QtLocation/QGeoCircle>
+#include <QtPositioning/QGeoCircle>
#include <QtCore/QDebug>
@@ -50,35 +50,55 @@ QT_BEGIN_NAMESPACE
/*!
\qmlbasictype geocircle
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
+ \inqmlmodule QtPositioning 5.0
+ \ingroup qml-QtPositioning5-basictypes
+ \since Qt Positioning 5.0
\brief The geocircle type represents a circular geographic area.
The \c geocircle type is a \l {geoshape} that represents a circular
geographic area. It is defined in terms of a \l {coordinate} which
- specifies the \c center of the circle and a qreal which specifies the \c radius of the circle
+ specifies the \l center of the circle and a qreal which specifies the \l radius of the circle
in meters.
- The circle is considered invalid if the center coordinate is invalid or if the radius is less
+ The circle is considered invalid if the \l center coordinate is invalid or if the \l radius is less
than zero.
\section2 Example Usage
Use properties of type \l variant to store a \c {geocircle}. To create a \c geocircle value,
- use the \l {QtLocation::circle}{QtLocation.circle()} function:
+ use the \l {QtPositioning::circle}{QtPositioning.circle()} function:
\qml
- import QtLocation 5.0
+ import QtPositioning 5.0
Item {
- property variant region: QtLocation.circle(QtLocation.coordinate(-27.5, 153.1), 1000)
+ property variant region: QtPositioning.circle(QtPositioning.coordinate(-27.5, 153.1), 1000)
}
\endqml
When integrating with C++, note that any QGeoCircle value passed into QML from C++ is
automatically converted into a \c geocircle value, and vise-versa.
+
+ \section2 Properties
+
+ \section3 center
+
+ \code
+ coordinate radius
+ \endcode
+
+ This property holds the coordinate of the center of the geocircle.
+
+ \section3 radius
+
+ \code
+ real radius
+ \endcode
+
+ This property holds the radius of the geocircle in meters.
+
+ The default value for the radius is -1 indicating an invalid geocircle area.
*/
GeoCircleValueType::GeoCircleValueType(QObject *parent)
@@ -109,7 +129,7 @@ void GeoCircleValueType::setCenter(const QGeoCoordinate &coordinate)
v = c;
}
-/*!
+/*
This property holds the radius of the geocircle in meters.
The default value for the radius is -1 indicating an invalid geocircle area.
diff --git a/src/imports/location/qdeclarativegeocircle.h b/src/imports/positioning/qdeclarativegeocircle.h
index 7345d697..82948f8f 100644
--- a/src/imports/location/qdeclarativegeocircle.h
+++ b/src/imports/positioning/qdeclarativegeocircle.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/imports/location/qdeclarativegeorectangle.cpp b/src/imports/positioning/qdeclarativegeorectangle.cpp
index 8dc0dd6a..f1162b77 100644
--- a/src/imports/location/qdeclarativegeorectangle.cpp
+++ b/src/imports/positioning/qdeclarativegeorectangle.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -42,7 +42,7 @@
#include "qdeclarativegeorectangle.h"
#include <QtCore/qnumeric.h>
-#include <QtLocation/QGeoRectangle>
+#include <QtPositioning/QGeoRectangle>
#include <QtCore/QDebug>
@@ -50,25 +50,25 @@ QT_BEGIN_NAMESPACE
/*!
\qmlbasictype georectangle
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
+ \inqmlmodule QtPositioning 5.0
+ \ingroup qml-QtPositioning5-basictypes
+ \since Qt Positioning 5.0
\brief The georectangle type represents a rectangular geographic area.
The \c georectangle type is a \l {geoshape} that represents a
rectangular geographic area. It is defined by a pair of
\l {coordinate}{coordinates} which represent the top-left and bottom-right corners
- of the \c {georectangle}. The coordinates are accessible from the \c topLeft and
- \c bottomRight attributes.
+ of the \c {georectangle}. The coordinates are accessible from the \l topLeft and
+ \l bottomRight attributes.
A \c georectangle is considered invalid if the top-left or bottom-right coordinates are invalid
or if the top-left coordinate is South of the bottom-right coordinate.
The coordinates of the four corners of the \c georectangle can be accessed with the
- \c {topLeft}, \c {topRight}, \c {bottomLeft} and \c {bottomRight} attributes. The \c center
- attribute can be used to get the coordinate of the center of the \c georectangle. The \c width
- and \c height attributes can be used to get the width and height of the \c georectangle in
+ \l {topLeft}, \l {topRight}, \l {bottomLeft} and \l {bottomRight} attributes. The \l center
+ attribute can be used to get the coordinate of the center of the \c georectangle. The \l width
+ and \l height attributes can be used to get the width and height of the \c georectangle in
degrees. Setting one of these attributes will cause the other attributes to be adjusted
accordingly.
@@ -83,18 +83,79 @@ QT_BEGIN_NAMESPACE
\section2 Example Usage
Use properties of type \l variant to store a \c {georectangle}. To create a \c georectangle
- value, use the \l {QtLocation::rectangle}{QtLocation.rectangle()} function:
+ value, use the \l {QtPositioning::rectangle}{QtPositioning.rectangle()} function:
\qml
- import QtLocation 5.0
+ import QtPositioning 5.0
Item {
- property variant region: QtLocation.rectangle(QtLocation.coordinate(-27.5, 153.1), QtLocation.coordinate(-27.6, 153.2))
+ property variant region: QtPositioning.rectangle(QtPositioning.coordinate(-27.5, 153.1), QtPositioning.coordinate(-27.6, 153.2))
}
\endqml
When integrating with C++, note that any QGeoRectangle value passed into QML from C++ is
automatically converted into a \c georectangle value, and vice-versa.
+
+ \section2 Properties
+
+ \section3 bottomLeft
+
+ \code
+ coordinate bottomLeft
+ \endcode
+
+ This property holds the bottom left coordinate of this georectangle.
+
+ \section3 bottomRight
+
+ \code
+ coordinate bottomRight
+ \endcode
+
+ This property holds the bottom right coordinate of this georectangle.
+
+ \section3 center
+
+ \code
+ coordinate center
+ \endcode
+
+ This property holds the center coordinate of this georectangle. For more details
+ see \l {QGeoRectangle::setCenter()}.
+
+ \section3 height
+
+ \code
+ double height
+ \endcode
+
+ This property holds the height of this georectangle (in degrees). For more details
+ see \l {QGeoRectangle::setHeight()}.
+
+ \section3 topLeft
+
+ \code
+ coordinate topLeft
+ \endcode
+
+ This property holds the top left coordinate of this georectangle.
+
+ \section3 topRight
+
+ \code
+ coordinate topRight
+ \endcode
+
+ This property holds the top right coordinate of this georectangle.
+
+ \section3 width
+
+ \code
+ double width
+ \endcode
+
+ This property holds the width of this georectangle (in degrees). For more details
+ see \l {QGeoRectangle::setWidth()}.
*/
GeoRectangleValueType::GeoRectangleValueType(QObject *parent)
diff --git a/src/imports/location/qdeclarativegeorectangle.h b/src/imports/positioning/qdeclarativegeorectangle.h
index 98c93d79..eaf63dce 100644
--- a/src/imports/location/qdeclarativegeorectangle.h
+++ b/src/imports/positioning/qdeclarativegeorectangle.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/imports/location/qdeclarativegeoshape.cpp b/src/imports/positioning/qdeclarativegeoshape.cpp
index e08f8edc..d79f5622 100644
--- a/src/imports/location/qdeclarativegeoshape.cpp
+++ b/src/imports/positioning/qdeclarativegeoshape.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -41,31 +41,30 @@
#include "qdeclarativegeoshape.h"
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCircle>
+#include <QtPositioning/QGeoRectangle>
+#include <QtPositioning/QGeoCircle>
QT_BEGIN_NAMESPACE
/*!
\qmlbasictype geoshape
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-basictypes
- \since Qt Location 5.0
+ \inqmlmodule QtPositioning 5.0
+ \ingroup qml-QtPositioning5-basictypes
+ \since Qt Positioning 5.0
\brief A geoshape type represents an abstract geographic area.
The \c geoshape type represents an abstract geographic area. It includes attributes and
methods common to all geographic areas. To create objects that represent a valid geographic
- area use \l {georectangle}{georectangle} or
- \l {geocircle}{geocircle}.
+ area use \l {georectangle} or \l {geocircle}.
- The \c isValid attribute can be used to test if the geoshape represents a valid geographic
+ The \l isValid attribute can be used to test if the geoshape represents a valid geographic
area.
- The \c isEmpty attribute can be used to test if the geoshape represents a region with a
+ The \l isEmpty attribute can be used to test if the geoshape represents a region with a
geomatrical area of 0.
- The \l contains() method can be used to test if a \l {QtLocation::coordinate}{coordinate} is
+ The \l contains() method can be used to test if a \l {coordinate} is
within the geoshape.
\section2 Example Usage
@@ -76,26 +75,50 @@ QT_BEGIN_NAMESPACE
To create a \c geoshape value, specify it as a "shape()" string:
\qml
- import QtLocation
+ import QtPositioning
Item {
property variant region: "shape()"
}
\endqml
- or with the \l {QtLocation::QtLocation}{QtLocation.shape()} function:
+ or with the \l {QtPositioning::shape}{QtPositioning.shape()} function:
\qml
- import QtLocation 5.0
+ import QtPositioning 5.0
Item {
- property variant region: QtLocation.shape()
+ property variant region: QtPositioning.shape()
}
\endqml
When integrating with C++, note that any QGeoShape value passed into QML from C++ is
automatically converted into a \c geoshape value, and vice-versa.
+ \section2 Properties
+
+ \section3 isEmpty
+
+ \code
+ bool isEmpty
+ \endcode
+
+ Returns whether this geo shape is empty. An empty geo shape is a region which has
+ a geometrical area of 0.
+
+ \section3 isValid
+
+ \code
+ bool isValid
+ \endcode
+
+ Returns whether this geo shape is valid.
+
+ 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.
+
+
\section2 Methods
\section3 contains()
@@ -104,7 +127,7 @@ QT_BEGIN_NAMESPACE
bool contains(coordinate coord)
\endcode
- Returns true if the \l {QtLocation::coordinate}{coordinate} specified by \a coord is within
+ Returns true if the \l {QtPositioning::coordinate}{coordinate} specified by \a coord is within
this geoshape; Otherwise returns false.
*/
diff --git a/src/imports/location/qdeclarativegeoshape.h b/src/imports/positioning/qdeclarativegeoshape.h
index 9f0c16db..e75830b0 100644
--- a/src/imports/location/qdeclarativegeoshape.h
+++ b/src/imports/positioning/qdeclarativegeoshape.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -43,7 +43,7 @@
#define QDECLARATIVEGEOSHAPE_H
#include <QtQml/private/qqmlvaluetype_p.h>
-#include <QtLocation/QGeoShape>
+#include <QtPositioning/QGeoShape>
QT_BEGIN_NAMESPACE
diff --git a/src/imports/location/qdeclarativeposition.cpp b/src/imports/positioning/qdeclarativeposition.cpp
index bbd53423..bce1b1fa 100644
--- a/src/imports/location/qdeclarativeposition.cpp
+++ b/src/imports/positioning/qdeclarativeposition.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -49,9 +49,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Position
\instantiates QDeclarativePosition
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
+ \inqmlmodule QtPositioning 5.0
+ \since Qt Positioning 5.0
\brief The Position type holds positional data at a particular point in time,
such as coordinate (longitude, latitude, altitude) and speed.
diff --git a/src/imports/location/qdeclarativeposition_p.h b/src/imports/positioning/qdeclarativeposition_p.h
index bf424176..99c2d8fc 100644
--- a/src/imports/location/qdeclarativeposition_p.h
+++ b/src/imports/positioning/qdeclarativeposition_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/imports/location/qdeclarativepositionsource.cpp b/src/imports/positioning/qdeclarativepositionsource.cpp
index d4605a42..97ad1bbc 100644
--- a/src/imports/location/qdeclarativepositionsource.cpp
+++ b/src/imports/positioning/qdeclarativepositionsource.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -54,9 +54,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype PositionSource
\instantiates QDeclarativePositionSource
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
+ \inqmlmodule QtPositioning 5.0
+ \since Qt Positioning 5.0
\brief The PositionSource type provides the device's current position.
@@ -111,7 +110,7 @@ QT_BEGIN_NAMESPACE
a PositionSource in your application to retrieve local data for users
from a REST web service.
- \sa {QtLocation5::Position}, {QGeoPositionInfoSource}
+ \sa {QtPositioning5::Position}, {QGeoPositionInfoSource}
*/
diff --git a/src/imports/location/qdeclarativepositionsource_p.h b/src/imports/positioning/qdeclarativepositionsource_p.h
index dea18b62..70506c00 100644
--- a/src/imports/location/qdeclarativepositionsource_p.h
+++ b/src/imports/positioning/qdeclarativepositionsource_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtLocation module of the Qt Toolkit.
+** This file is part of the QtPositioning module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -46,7 +46,7 @@
#include <QtCore/QObject>
#include <QtQml/QQmlParserStatus>
-#include <QtLocation/QGeoPositionInfoSource>
+#include <QtPositioning/QGeoPositionInfoSource>
QT_BEGIN_NAMESPACE
diff --git a/src/imports/positioning/qmldir b/src/imports/positioning/qmldir
new file mode 100644
index 00000000..4143e0d5
--- /dev/null
+++ b/src/imports/positioning/qmldir
@@ -0,0 +1,3 @@
+module QtPositioning
+plugin declarative_positioning
+typeinfo plugins.qmltypes