summaryrefslogtreecommitdiff
path: root/src/imports/location
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/location')
-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/locationsingleton.cpp164
-rw-r--r--src/imports/location/locationsingleton.h75
-rw-r--r--src/imports/location/locationvaluetypehelper.cpp122
-rw-r--r--src/imports/location/locationvaluetypehelper_p.h (renamed from src/imports/location/qdeclarativegeocircle.h)41
-rw-r--r--src/imports/location/locationvaluetypeprovider.cpp310
-rw-r--r--src/imports/location/locationvaluetypeprovider.h172
-rw-r--r--src/imports/location/plugins.qmltypes165
-rw-r--r--src/imports/location/qdeclarativecirclemapitem.cpp4
-rw-r--r--src/imports/location/qdeclarativecoordinate.cpp271
-rw-r--r--src/imports/location/qdeclarativecoordinate_p.h85
-rw-r--r--src/imports/location/qdeclarativegeoaddress.cpp360
-rw-r--r--src/imports/location/qdeclarativegeoaddress_p.h113
-rw-r--r--src/imports/location/qdeclarativegeocircle.cpp186
-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/qdeclarativegeorectangle.cpp296
-rw-r--r--src/imports/location/qdeclarativegeorectangle.h89
-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/qdeclarativegeoshape.cpp197
-rw-r--r--src/imports/location/qdeclarativegeoshape.h86
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp11
-rw-r--r--src/imports/location/qdeclarativepolylinemapitem.cpp6
-rw-r--r--src/imports/location/qdeclarativeposition.cpp376
-rw-r--r--src/imports/location/qdeclarativeposition_p.h132
-rw-r--r--src/imports/location/qdeclarativepositionsource.cpp647
-rw-r--r--src/imports/location/qdeclarativepositionsource_p.h150
-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
50 files changed, 196 insertions, 4303 deletions
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/locationsingleton.cpp b/src/imports/location/locationsingleton.cpp
deleted file mode 100644
index e4f9a833..00000000
--- a/src/imports/location/locationsingleton.cpp
+++ /dev/null
@@ -1,164 +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 "locationsingleton.h"
-
-/*!
- \qmltype QtLocation
- \instantiates LocationSingleton
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-common
-
- \brief The QtLocation global object provides useful functions for working with Qt Location
- types in QML.
-
- \qml
- import QtLocation 5.0
-
- Item {
- property variant coordinate: QtLocation.coordinate(-27.5, 153.1)
- }
- \endqml
-*/
-
-LocationSingleton::LocationSingleton(QObject *parent)
-: QObject(parent)
-{
-}
-
-/*!
- \qmlmethod coordinate QtLocation5::QtLocation::coordinate()
-
- Constructs an invalid coordinate.
-
-*/
-QGeoCoordinate LocationSingleton::coordinate() const
-{
- return QGeoCoordinate();
-}
-
-/*!
- \qmlmethod coordinate QtLocation5::QtLocation::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.
-
- \sa {coordinate}
-*/
-QGeoCoordinate LocationSingleton::coordinate(double latitude, double longitude, double altitude) const
-{
- return QGeoCoordinate(latitude, longitude, altitude);
-}
-
-/*!
- \qmlmethod geoshape QtLocation5::QtLocation::shape() const
-
- Constructs an invalid geoshape.
-
- \sa {geoshape}
-*/
-QGeoShape LocationSingleton::shape() const
-{
- return QGeoShape();
-}
-
-/*!
- \qmlmethod georectangle QtLocation5::QtLocation::rectangle() const
-
- Constructs an invalid georectangle.
-
- \sa {georectangle}
-*/
-QGeoRectangle LocationSingleton::rectangle() const
-{
- return QGeoRectangle();
-}
-
-/*!
- \qmlmethod georectangle QtLocation5::QtLocation::rectangle(coordinate center, real width, real height) const
-
- Constructs a georectangle centered at \a center with a width of \a width degrees and a hight of
- \a height degrees.
-
- \sa {georectangle}
-*/
-QGeoRectangle LocationSingleton::rectangle(const QGeoCoordinate &center,
- double width, double height) const
-{
- return QGeoRectangle(center, width, height);
-}
-
-/*!
- \qmlmethod georectangle QtLocation5::QtLocation::rectangle(coordinate topLeft, coordinate bottomRight) const
-
- Constructs a georectangle with its top left corner positioned at \a topLeft and its bottom
- right corner positioned at \a {bottomLeft}.
-
- \sa {georectangle}
-*/
-QGeoRectangle LocationSingleton::rectangle(const QGeoCoordinate &topLeft,
- const QGeoCoordinate &bottomRight) const
-{
- return QGeoRectangle(topLeft, bottomRight);
-}
-
-/*!
- \qmlmethod geocircle QtLocation5::QtLocation::circle() const
-
- Constructs an invalid geocircle.
-
- \sa {geocircle}
-*/
-QGeoCircle LocationSingleton::circle() const
-{
- return QGeoCircle();
-}
-
-/*!
- \qmlmethod geocircle QtLocation5::QtLocation::circle(coordinate center, real radius) const
-
- Constructs a geocircle centered at \a center with a radius of \a radius meters.
-*/
-QGeoCircle LocationSingleton::circle(const QGeoCoordinate &center, qreal radius) const
-{
- return QGeoCircle(center, radius);
-}
-
diff --git a/src/imports/location/locationsingleton.h b/src/imports/location/locationsingleton.h
deleted file mode 100644
index b3839ba5..00000000
--- a/src/imports/location/locationsingleton.h
+++ /dev/null
@@ -1,75 +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 LOCATIONSINGLETON_H
-#define LOCATIONSINGLETON_H
-
-#include <QtCore/QObject>
-#include <QtCore/qnumeric.h>
-#include <QtLocation/QGeoCoordinate>
-#include <QtLocation/QGeoShape>
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCircle>
-
-class LocationSingleton : public QObject
-{
- Q_OBJECT
-
-public:
- explicit LocationSingleton(QObject *parent = 0);
-
- Q_INVOKABLE QGeoCoordinate coordinate() const;
- Q_INVOKABLE QGeoCoordinate coordinate(double latitude, double longitude,
- double altitude = qQNaN()) const;
-
- Q_INVOKABLE QGeoShape shape() const;
-
- Q_INVOKABLE QGeoRectangle rectangle() const;
- Q_INVOKABLE QGeoRectangle rectangle(const QGeoCoordinate &center,
- double width, double height) const;
- Q_INVOKABLE QGeoRectangle rectangle(const QGeoCoordinate &topLeft,
- const QGeoCoordinate &bottomRight) const;
-
- Q_INVOKABLE QGeoCircle circle() const;
- Q_INVOKABLE QGeoCircle circle(const QGeoCoordinate &center, qreal radius = -1.0) const;
-};
-
-#endif // LOCATIONSINGLETON_H
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/qdeclarativegeocircle.h b/src/imports/location/locationvaluetypehelper_p.h
index 7345d697..9c5bb481 100644
--- a/src/imports/location/qdeclarativegeocircle.h
+++ b/src/imports/location/locationvaluetypehelper_p.h
@@ -37,39 +37,18 @@
**
** $QT_END_LICENSE$
**
-***************************************************************************/
+****************************************************************************/
-#ifndef QDECLARATIVEGEOCIRCLE_H
-#define QDECLARATIVEGEOCIRCLE_H
+#ifndef LOCATION_VALUE_TYPE_HELPER
+#define LOCATION_VALUE_TYPE_HELPER
-#include "qdeclarativegeoshape.h"
+#include <QJSValue>
+#include <QGeoCoordinate>
+#include <QGeoRectangle>
+#include <QGeoCircle>
-QT_BEGIN_NAMESPACE
-
-class GeoCircleValueType : public GeoShapeValueType
-{
- Q_OBJECT
-
- Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter)
- Q_PROPERTY(qreal radius READ radius WRITE setRadius)
-
-public:
- explicit GeoCircleValueType(QObject *parent = 0);
- ~GeoCircleValueType();
-
- QGeoCoordinate center();
- void setCenter(const QGeoCoordinate &coordinate);
-
- qreal radius() const;
- void setRadius(qreal radius);
-
- QString toString() const Q_DECL_OVERRIDE;
- void setValue(const QVariant &value) Q_DECL_OVERRIDE;
- QVariant value() Q_DECL_OVERRIDE;
- void write(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags flags) Q_DECL_OVERRIDE;
- void writeVariantValue(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags, QVariant *from) Q_DECL_OVERRIDE;
-};
-
-QT_END_NAMESPACE
+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/locationvaluetypeprovider.cpp b/src/imports/location/locationvaluetypeprovider.cpp
deleted file mode 100644
index 0477e72a..00000000
--- a/src/imports/location/locationvaluetypeprovider.cpp
+++ /dev/null
@@ -1,310 +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 "locationvaluetypeprovider.h"
-#include "qdeclarativecoordinate_p.h"
-#include "qdeclarativegeoshape.h"
-#include "qdeclarativegeorectangle.h"
-#include "qdeclarativegeocircle.h"
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/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()
-{
-}
-
-bool LocationValueTypeProvider::create(int type, QQmlValueType *&v)
-{
- if (type == qMetaTypeId<QGeoCoordinate>())
- return typedCreate<CoordinateValueType>(v);
- else if (type == qMetaTypeId<QGeoShape>())
- return typedCreate<GeoShapeValueType>(v);
- else if (type == qMetaTypeId<QGeoRectangle>())
- return typedCreate<GeoRectangleValueType>(v);
- else if (type == qMetaTypeId<QGeoCircle>())
- return typedCreate<GeoCircleValueType>(v);
-
- return false;
-}
-
-bool LocationValueTypeProvider::init(int type, void *data, size_t dataSize)
-{
- if (type == qMetaTypeId<QGeoCoordinate>())
- return typedInit<QGeoCoordinate>(data, dataSize);
- else if (type == qMetaTypeId<QGeoShape>())
- return typedInit<QGeoShape>(data, dataSize);
- else if (type == qMetaTypeId<QGeoRectangle>())
- return typedInit<QGeoRectangle>(data, dataSize);
- else if (type == qMetaTypeId<QGeoCircle>())
- return typedInit<QGeoCircle>(data, dataSize);
-
- return false;
-}
-
-bool LocationValueTypeProvider::destroy(int type, void *data, size_t dataSize)
-{
- if (type == qMetaTypeId<QGeoCoordinate>())
- return typedDestroy<QGeoCoordinate>(data, dataSize);
- else if (type == qMetaTypeId<QGeoShape>())
- return typedDestroy<QGeoShape>(data, dataSize);
- else if (type == qMetaTypeId<QGeoRectangle>())
- return typedDestroy<QGeoRectangle>(data, dataSize);
- else if (type == qMetaTypeId<QGeoCircle>())
- return typedDestroy<QGeoCircle>(data, dataSize);
-
- return false;
-}
-
-bool LocationValueTypeProvider::copy(int type, const void *src, void *dst, size_t dstSize)
-{
- if (type == qMetaTypeId<QGeoCoordinate>())
- return typedCopyConstruct<QGeoCoordinate>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoShape>())
- return typedCopyConstruct<QGeoShape>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoRectangle>())
- return typedCopyConstruct<QGeoRectangle>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoCircle>())
- return typedCopyConstruct<QGeoCircle>(src, dst, dstSize);
-
- return false;
-}
-
-bool LocationValueTypeProvider::create(int type, int argc, const void *argv[], QVariant *v)
-{
- if (type == qMetaTypeId<QGeoCoordinate>()) {
- if (argc == 2) {
- const float *a = reinterpret_cast<const float *>(argv[0]);
- const float *b = reinterpret_cast<const float *>(argv[1]);
- *v = QVariant::fromValue(QGeoCoordinate(*a, *b));
- return true;
- } else if (argc == 3) {
- const float *a = reinterpret_cast<const float *>(argv[0]);
- const float *b = reinterpret_cast<const float *>(argv[1]);
- const float *c = reinterpret_cast<const float *>(argv[2]);
- *v = QVariant::fromValue(QGeoCoordinate(*a, *b, *c));
- return true;
- }
- }
-
- return false;
-}
-
-bool LocationValueTypeProvider::createFromString(int type, const QString &s, void *data, size_t dataSize)
-{
- Q_UNUSED(data)
- Q_UNUSED(dataSize)
-
- if (type == qMetaTypeId<QGeoCoordinate>() || type == qMetaTypeId<QGeoShape>() ||
- type == qMetaTypeId<QGeoRectangle>() || type == qMetaTypeId<QGeoCircle>()) {
- qWarning("Cannot create value type %d from string '%s'", type, qPrintable(s));
- }
-
- return false;
-}
-
-bool LocationValueTypeProvider::createStringFrom(int type, const void *data, QString *s)
-{
- Q_UNUSED(data)
- Q_UNUSED(s)
-
- if (type == qMetaTypeId<QGeoCoordinate>() || type == qMetaTypeId<QGeoShape>() ||
- type == qMetaTypeId<QGeoRectangle>() || type == qMetaTypeId<QGeoCircle>()) {
- qWarning("Cannot create string from value type %d", type);
- }
-
- return false;
-}
-
-bool LocationValueTypeProvider::variantFromJsObject(int type, QQmlV4Handle h, QV8Engine *e, QVariant *v)
-{
- Q_UNUSED(h)
- Q_UNUSED(e)
- Q_UNUSED(v)
-
- if (type == qMetaTypeId<QGeoCoordinate>() || type == qMetaTypeId<QGeoShape>() ||
- type == qMetaTypeId<QGeoRectangle>() || type == qMetaTypeId<QGeoCircle>()) {
- qWarning("Cannot create variant from js object for type %d", type);
- }
-
- return false;
-}
-
-bool LocationValueTypeProvider::equal(int type, const void *lhs, const void *rhs, size_t rhsSize)
-{
- Q_UNUSED(rhsSize)
-
- if (type == qMetaTypeId<QGeoCoordinate>())
- return typedEqual<QGeoCoordinate>(lhs, rhs);
- else if (type == qMetaTypeId<QGeoShape>())
- return typedEqual<QGeoShape>(lhs, rhs);
- else if (type == qMetaTypeId<QGeoRectangle>())
- return typedEqual<QGeoRectangle>(lhs, rhs);
- else if (type == qMetaTypeId<QGeoCircle>())
- return typedEqual<QGeoCircle>(lhs, rhs);
-
- return false;
-}
-
-bool LocationValueTypeProvider::store(int type, const void *src, void *dst, size_t dstSize)
-{
- if (type == qMetaTypeId<QGeoCoordinate>())
- return typedStore<QGeoCoordinate>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoShape>())
- return typedStore<QGeoShape>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoRectangle>())
- return typedStore<QGeoRectangle>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoCircle>())
- return typedStore<QGeoCircle>(src, dst, dstSize);
-
- return false;
-}
-
-bool LocationValueTypeProvider::read(int srcType, const void *src, size_t srcSize, int dstType, void *dst)
-{
- if (srcType == qMetaTypeId<QGeoCoordinate>())
- return typedRead<QGeoCoordinate>(srcType, src, srcSize, dstType, dst);
- else if (srcType == qMetaTypeId<QGeoShape>())
- return typedRead<QGeoShape>(srcType, src, srcSize, dstType, dst);
- else if (srcType == qMetaTypeId<QGeoRectangle>())
- return typedRead<QGeoRectangle>(srcType, src, srcSize, dstType, dst);
- else if (srcType == qMetaTypeId<QGeoCircle>())
- return typedRead<QGeoCircle>(srcType, src, srcSize, dstType, dst);
-
- return false;
-}
-
-bool LocationValueTypeProvider::write(int type, const void *src, void *dst, size_t dstSize)
-{
- if (type == qMetaTypeId<QGeoCoordinate>())
- return typedWrite<QGeoCoordinate>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoShape>())
- return typedWrite<QGeoShape>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoRectangle>())
- return typedWrite<QGeoRectangle>(src, dst, dstSize);
- else if (type == qMetaTypeId<QGeoCircle>())
- return typedWrite<QGeoCircle>(src, dst, dstSize);
-
- return false;
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/locationvaluetypeprovider.h b/src/imports/location/locationvaluetypeprovider.h
deleted file mode 100644
index 2d204aa5..00000000
--- a/src/imports/location/locationvaluetypeprovider.h
+++ /dev/null
@@ -1,172 +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 LOCATIONVALUETYPEPROVIDER_H
-#define LOCATIONVALUETYPEPROVIDER_H
-
-#include <QtQml/private/qqmlglobal_p.h>
-
-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:
- LocationValueTypeProvider();
-
-private:
- template<typename T>
- bool typedCreate(QQmlValueType *&v)
- {
- v = new T;
- return true;
- }
-
- bool create(int type, QQmlValueType *&v) Q_DECL_OVERRIDE;
-
- template<typename T>
- bool typedInit(void *data, size_t dataSize)
- {
- Q_ASSERT(dataSize >= sizeof(T));
- Q_UNUSED(dataSize);
- T *t = reinterpret_cast<T *>(data);
- new (t) T();
- return true;
- }
-
- bool init(int type, void *data, size_t dataSize) Q_DECL_OVERRIDE;
-
- template<typename T>
- bool typedDestroy(void *data, size_t dataSize)
- {
- Q_ASSERT(dataSize >= sizeof(T));
- Q_UNUSED(dataSize);
- T *t = reinterpret_cast<T *>(data);
- t->~T();
- return true;
- }
-
- bool destroy(int type, void *data, size_t dataSize) Q_DECL_OVERRIDE;
-
- template<typename T>
- bool typedCopyConstruct(const void *src, void *dst, size_t dstSize)
- {
- Q_ASSERT(dstSize >= sizeof(T));
- Q_UNUSED(dstSize);
- const T *srcT = reinterpret_cast<const T *>(src);
- T *dstT = reinterpret_cast<T *>(dst);
- new (dstT) T(*srcT);
- return true;
- }
-
- bool copy(int type, const void *src, void *dst, size_t dstSize) Q_DECL_OVERRIDE;
-
- bool create(int type, int argc, const void *argv[], QVariant *v) Q_DECL_OVERRIDE;
- bool createFromString(int type, const QString &s, void *data, size_t dataSize) Q_DECL_OVERRIDE;
- bool createStringFrom(int type, const void *data, QString *s) Q_DECL_OVERRIDE;
-
- bool variantFromJsObject(int type, QQmlV4Handle h, QV8Engine *e, QVariant *v) Q_DECL_OVERRIDE;
-
- template<typename T>
- bool typedEqual(const void *lhs, const void *rhs)
- {
- return *reinterpret_cast<const T *>(lhs) == *reinterpret_cast<const T *>(rhs);
- }
-
- bool equal(int type, const void *lhs, const void *rhs, size_t rhsSize) Q_DECL_OVERRIDE;
-
- template<typename T>
- bool typedStore(const void *src, void *dst, size_t dstSize)
- {
- Q_ASSERT(dstSize >= sizeof(T));
- Q_UNUSED(dstSize);
- const T *srcT = reinterpret_cast<const T *>(src);
- T *dstT = reinterpret_cast<T *>(dst);
- new (dstT) T(*srcT);
- return true;
- }
-
- bool store(int type, const void *src, void *dst, size_t dstSize) Q_DECL_OVERRIDE;
-
- template<typename T>
- bool typedRead(int srcType, const void *src, size_t srcSize, int dstType, void *dst)
- {
- T *dstT = reinterpret_cast<T *>(dst);
- if (srcType == dstType) {
- Q_ASSERT(srcSize >= sizeof(T));
- Q_UNUSED(srcSize);
- const T *srcT = reinterpret_cast<const T *>(src);
- *dstT = *srcT;
- } else {
- *dstT = T();
- }
- return true;
- }
-
- bool read(int srcType, const void *src, size_t srcSize, int dstType, void *dst) Q_DECL_OVERRIDE;
-
- template<typename T>
- bool typedWrite(const void *src, void *dst, size_t dstSize)
- {
- Q_ASSERT(dstSize >= sizeof(T));
- Q_UNUSED(dstSize);
- const T *srcT = reinterpret_cast<const T *>(src);
- T *dstT = reinterpret_cast<T *>(dst);
- if (*dstT != *srcT) {
- *dstT = *srcT;
- return true;
- }
- return false;
- }
-
- bool write(int type, const void *src, void *dst, size_t dstSize) Q_DECL_OVERRIDE;
-};
-
-QT_END_NAMESPACE
-
-#endif // LOCATIONVALUETYPEPROVIDER_H
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/qdeclarativecoordinate.cpp b/src/imports/location/qdeclarativecoordinate.cpp
deleted file mode 100644
index f832d4f2..00000000
--- a/src/imports/location/qdeclarativecoordinate.cpp
+++ /dev/null
@@ -1,271 +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 "qdeclarativecoordinate_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlbasictype coordinate
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-basictypes
- \since Qt Location 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
- 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
- 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
- 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
- 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.
-
- The coordinate type is used by many other types in the Qt Location module, for specifying
- the position of an object on a Map, the current position of a device and many other tasks.
- They also feature a number of important utility methods that make otherwise complex
- calculations simple to use, such as \l atDistanceAndAzimuth().
-
- \section2 Accuracy
-
- The latitude, longitude and altitude attributes stored in the coordinate type are represented
- as doubles, giving them approximately 16 decimal digits of precision -- enough to specify
- micrometers. The calculations performed in coordinate's methods such as \l azimuthTo() and
- \l distanceTo() also use doubles for all intermediate values, but the inherent inaccuracies in
- their spherical Earth model dominate the amount of error in their output.
-
- \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
- optional.
-
- To create a \c coordinate value, use the \l{QtLocation5::QtLocation}{QtLocation.coordinate()}
- function:
-
- \qml
- import QtLocation 5.0
-
- Location { coordinate: QtLocation.coordinate(-27.5, 153.1) }
- \endqml
-
- or as separate \c {latitude}, \c longitude and \c altitude components:
-
- \qml
- Location {
- coordinate {
- latitude: -27.5
- longitude: 153.1
- }
- }
- \endqml
-
- 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 Methods
-
- \section3 distanceTo()
-
- \code
- real distanceTo(coordinate other)
- \endcode
-
- Returns the distance (in meters) from this coordinate to the coordinate specified by \a other.
- Altitude is not used in the calculation.
-
- This calculation returns the great-circle distance between the two coordinates, with an
- assumption that the Earth is spherical for the purpose of this calculation.
-
- \section3 azimuthTo()
-
- \code
- real azimuth(coordinate other)
- \endcode
-
- Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by
- \a other. Altitude is not used in the calculation.
-
- There is an assumption that the Earth is spherical for the purpose of this calculation.
-
- \section3 atDistanceAndAzimuth()
-
- \code
- coordinate atDistanceAndAzimuth(real distance, real azimuth)
- \endcode
-
- Returns the coordinate that is reached by traveling \a distance metres from this coordinate at
- \a azimuth degrees along a great-circle.
-
- There is an assumption that the Earth is spherical for the purpose of this calculation.
-*/
-
-
-CoordinateValueType::CoordinateValueType(QObject *parent)
-: QQmlValueTypeBase<QGeoCoordinate>(qMetaTypeId<QGeoCoordinate>(), parent)
-{
-}
-
-CoordinateValueType::~CoordinateValueType()
-{
-}
-
-/*
- This property holds the value of altitude (meters above sea level).
- If the property has not been set, its default value is NaN.
-
-*/
-void CoordinateValueType::setAltitude(double altitude)
-{
- v.setAltitude(altitude);
-}
-
-double CoordinateValueType::altitude() const
-{
- return v.altitude();
-}
-
-/*
- 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.
-*/
-void CoordinateValueType::setLongitude(double longitude)
-{
- v.setLongitude(longitude);
-}
-
-double CoordinateValueType::longitude() const
-{
- return v.longitude();
-}
-
-/*
- 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.
-*/
-void CoordinateValueType::setLatitude(double latitude)
-{
- v.setLatitude(latitude);
-}
-
-double CoordinateValueType::latitude() const
-{
- return v.latitude();
-}
-
-/*
- 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.
-*/
-bool CoordinateValueType::isValid() const
-{
- return v.isValid();
-}
-
-QString CoordinateValueType::toString() const
-{
- return QStringLiteral("QGeoCoordinate(%1,%2,%3)")
- .arg(v.latitude()).arg(v.longitude()).arg(v.altitude());
-}
-
-bool CoordinateValueType::isEqual(const QVariant &other) const
-{
- if (other.userType() != qMetaTypeId<QGeoCoordinate>())
- return false;
-
- return v == other.value<QGeoCoordinate>();
-}
-
-/*
- Returns the distance (in meters) from this coordinate to the
- coordinate specified by other. Altitude is not used in the calculation.
-
- This calculation returns the great-circle distance between the two
- coordinates, with an assumption that the Earth is spherical for the
- purpose of this calculation.
-*/
-qreal CoordinateValueType::distanceTo(const QGeoCoordinate &coordinate) const
-{
- return v.distanceTo(coordinate);
-}
-
-/*
- Returns the azimuth (or bearing) in degrees from this coordinate to the
- coordinate specified by other. Altitude is not used in the calculation.
-
- There is an assumption that the Earth is spherical for the purpose of
- this calculation.
-*/
-qreal CoordinateValueType::azimuthTo(const QGeoCoordinate &coordinate) const
-{
- return v.azimuthTo(coordinate);
-}
-
-/*
- Returns the coordinate that is reached by traveling distance metres
- from the current coordinate at azimuth degrees along a great-circle.
-
- There is an assumption that the Earth is spherical for the purpose
- of this calculation.
-*/
-QGeoCoordinate CoordinateValueType::atDistanceAndAzimuth(qreal distance, qreal azimuth) const
-{
- return v.atDistanceAndAzimuth(distance, azimuth);
-}
-
-#include "moc_qdeclarativecoordinate_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativecoordinate_p.h b/src/imports/location/qdeclarativecoordinate_p.h
deleted file mode 100644
index 1e4e6dd5..00000000
--- a/src/imports/location/qdeclarativecoordinate_p.h
+++ /dev/null
@@ -1,85 +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 QDECLARATIVECOORDINATE_H
-#define QDECLARATIVECOORDINATE_H
-
-#include <QtQml/private/qqmlvaluetype_p.h>
-#include <QtLocation/QGeoCoordinate>
-
-QT_BEGIN_NAMESPACE
-
-class CoordinateValueType : public QQmlValueTypeBase<QGeoCoordinate>
-{
- Q_OBJECT
-
- Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
- Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
- Q_PROPERTY(double altitude READ altitude WRITE setAltitude)
- Q_PROPERTY(bool isValid READ isValid)
-
-public:
- explicit CoordinateValueType(QObject *parent = 0);
- ~CoordinateValueType();
-
- Q_INVOKABLE qreal distanceTo(const QGeoCoordinate &coordinate) const;
- Q_INVOKABLE qreal azimuthTo(const QGeoCoordinate &coordinate) const;
-
- Q_INVOKABLE QGeoCoordinate atDistanceAndAzimuth(qreal distance, qreal azimuth) const;
-
- double latitude() const;
- void setLatitude(double latitude);
-
- double longitude() const;
- void setLongitude(double longitude);
-
- double altitude() const;
- void setAltitude(double altitude);
-
- bool isValid() const;
-
- QString toString() const Q_DECL_OVERRIDE;
- bool isEqual(const QVariant &other) const Q_DECL_OVERRIDE;
-};
-
-QT_END_NAMESPACE
-
-#endif
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/qdeclarativegeocircle.cpp b/src/imports/location/qdeclarativegeocircle.cpp
deleted file mode 100644
index cfa533a9..00000000
--- a/src/imports/location/qdeclarativegeocircle.cpp
+++ /dev/null
@@ -1,186 +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 "qdeclarativegeocircle.h"
-
-#include <QtCore/qnumeric.h>
-#include <QtLocation/QGeoCircle>
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlbasictype geocircle
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 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
- in meters.
-
- The circle is considered invalid if the center coordinate is invalid or if the 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:
-
- \qml
- import QtLocation 5.0
-
- Item {
- property variant region: QtLocation.circle(QtLocation.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.
-*/
-
-GeoCircleValueType::GeoCircleValueType(QObject *parent)
-: GeoShapeValueType(qMetaTypeId<QGeoCircle>(), parent)
-{
-}
-
-GeoCircleValueType::~GeoCircleValueType()
-{
-}
-
-/*
- This property holds the coordinate of the center of the geocircle.
-*/
-QGeoCoordinate GeoCircleValueType::center()
-{
- return QGeoCircle(v).center();
-}
-
-void GeoCircleValueType::setCenter(const QGeoCoordinate &coordinate)
-{
- QGeoCircle c = v;
-
- if (c.center() == coordinate)
- return;
-
- c.setCenter(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.
-*/
-qreal GeoCircleValueType::radius() const
-{
- return QGeoCircle(v).radius();
-}
-
-void GeoCircleValueType::setRadius(qreal radius)
-{
- QGeoCircle c = v;
-
- if (c.radius() == radius)
- return;
-
- c.setRadius(radius);
- v = c;
-}
-
-QString GeoCircleValueType::toString() const
-{
- if (v.type() != QGeoShape::CircleType) {
- qWarning("Not a circle");
- return QStringLiteral("QGeoCircle(not a circle)");
- }
-
- QGeoCircle c = v;
- return QStringLiteral("QGeoCircle({%1, %2}, %3)")
- .arg(c.center().latitude())
- .arg(c.center().longitude())
- .arg(c.radius());
-}
-
-void GeoCircleValueType::setValue(const QVariant &value)
-{
- if (value.userType() == qMetaTypeId<QGeoCircle>())
- v = value.value<QGeoCircle>();
- else if (value.userType() == qMetaTypeId<QGeoShape>())
- v = value.value<QGeoShape>();
- else
- v = QGeoCircle();
-
- onLoad();
-}
-
-QVariant GeoCircleValueType::value()
-{
- return QVariant::fromValue(QGeoCircle(v));
-}
-
-void GeoCircleValueType::write(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags flags)
-{
- QGeoCircle c = v;
- writeProperty(obj, idx, flags, &c);
-}
-
-void GeoCircleValueType::writeVariantValue(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags flags, QVariant *from)
-{
- if (from->userType() == qMetaTypeId<QGeoCircle>()) {
- writeProperty(obj, idx, flags, from);
- } else if (from->userType() == qMetaTypeId<QGeoShape>()) {
- QGeoCircle c = from->value<QGeoShape>();
- QVariant v = QVariant::fromValue(c);
- writeProperty(obj, idx, flags, &v);
- } else {
- QVariant v = QVariant::fromValue(QGeoCircle());
- writeProperty(obj, idx, flags, &v);
- }
-}
-
-#include "moc_qdeclarativegeocircle.cpp"
-
-QT_END_NAMESPACE
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/qdeclarativegeorectangle.cpp b/src/imports/location/qdeclarativegeorectangle.cpp
deleted file mode 100644
index 8dc0dd6a..00000000
--- a/src/imports/location/qdeclarativegeorectangle.cpp
+++ /dev/null
@@ -1,296 +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 "qdeclarativegeorectangle.h"
-
-#include <QtCore/qnumeric.h>
-#include <QtLocation/QGeoRectangle>
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlbasictype georectangle
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 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.
-
- 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
- degrees. Setting one of these attributes will cause the other attributes to be adjusted
- accordingly.
-
- \section2 Limitations
-
- A \c georectangle can never cross the poles.
-
- If the height or center of a \c georectangle is adjusted such that it would cross one of the
- poles the height is modified such that the \c georectangle touches but does not cross the pole
- and that the center coordinate is still in the center of the \c georectangle.
-
- \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:
-
- \qml
- import QtLocation 5.0
-
- Item {
- property variant region: QtLocation.rectangle(QtLocation.coordinate(-27.5, 153.1), QtLocation.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.
-*/
-
-GeoRectangleValueType::GeoRectangleValueType(QObject *parent)
-: GeoShapeValueType(qMetaTypeId<QGeoRectangle>(), parent)
-{
-}
-
-GeoRectangleValueType::~GeoRectangleValueType()
-{
-}
-
-QGeoCoordinate GeoRectangleValueType::bottomLeft()
-{
- return QGeoRectangle(v).bottomLeft();
-}
-
-/*
- This property holds the bottom left coordinate of this georectangle.
-*/
-void GeoRectangleValueType::setBottomLeft(const QGeoCoordinate &coordinate)
-{
- QGeoRectangle r = v;
-
- if (r.bottomLeft() == coordinate)
- return;
-
- r.setBottomLeft(coordinate);
- v = r;
-}
-
-QGeoCoordinate GeoRectangleValueType::bottomRight()
-{
- return QGeoRectangle(v).bottomRight();
-}
-
-/*
- This property holds the bottom right coordinate of this georectangle.
-*/
-void GeoRectangleValueType::setBottomRight(const QGeoCoordinate &coordinate)
-{
- QGeoRectangle r = v;
-
- if (r.bottomRight() == coordinate)
- return;
-
- r.setBottomRight(coordinate);
- v = r;
-}
-
-QGeoCoordinate GeoRectangleValueType::topLeft()
-{
- return QGeoRectangle(v).topLeft();
-}
-
-/*
- This property holds the top left coordinate of this georectangle.
-*/
-void GeoRectangleValueType::setTopLeft(const QGeoCoordinate &coordinate)
-{
- QGeoRectangle r = v;
-
- if (r.topLeft() == coordinate)
- return;
-
- r.setTopLeft(coordinate);
- v = r;
-}
-
-QGeoCoordinate GeoRectangleValueType::topRight()
-{
- return QGeoRectangle(v).topRight();
-}
-
-/*
- This property holds the top right coordinate of this georectangle.
-*/
-void GeoRectangleValueType::setTopRight(QGeoCoordinate &coordinate)
-{
- QGeoRectangle r = v;
-
- if (r.topRight() == coordinate)
- return;
-
- r.setTopRight(coordinate);
- v = r;
-}
-
-QGeoCoordinate GeoRectangleValueType::center()
-{
- return QGeoRectangle(v).center();
-}
-
-/*
- This property holds the center coordinate of this georectangle.
-*/
-void GeoRectangleValueType::setCenter(const QGeoCoordinate &coordinate)
-{
- QGeoRectangle r = v;
-
- if (r.center() == coordinate)
- return;
-
- r.setCenter(coordinate);
- v = r;
-}
-
-double GeoRectangleValueType::height()
-{
- return QGeoRectangle(v).height();
-}
-
-/*
- This property holds the height of this georectangle (in degrees).
-*/
-void GeoRectangleValueType::setHeight(double height)
-{
- QGeoRectangle r = v;
-
- if (!r.isValid())
- r.setCenter(QGeoCoordinate(0.0, 0.0));
-
- r.setHeight(height);
- v = r;
-}
-
-double GeoRectangleValueType::width()
-{
- return QGeoRectangle(v).width();
-}
-
-/*
- This property holds the width of this georectangle (in degrees).
-*/
-void GeoRectangleValueType::setWidth(double width)
-{
- QGeoRectangle r = v;
-
- if (!r.isValid())
- r.setCenter(QGeoCoordinate(0.0, 0.0));
-
- r.setWidth(width);
- v = r;
-}
-
-QString GeoRectangleValueType::toString() const
-{
- if (v.type() != QGeoShape::RectangleType) {
- qWarning("Not a rectangle a %d\n", v.type());
- return QStringLiteral("QGeoRectangle(not a rectangle)");
- }
-
- QGeoRectangle r = v;
- return QStringLiteral("QGeoRectangle({%1, %2}, {%3, %4})")
- .arg(r.topLeft().latitude())
- .arg(r.topLeft().longitude())
- .arg(r.bottomRight().latitude())
- .arg(r.bottomRight().longitude());
-}
-
-void GeoRectangleValueType::setValue(const QVariant &value)
-{
- if (value.userType() == qMetaTypeId<QGeoRectangle>())
- v = value.value<QGeoRectangle>();
- else if (value.userType() == qMetaTypeId<QGeoShape>())
- v = value.value<QGeoShape>();
- else
- v = QGeoRectangle();
-
- onLoad();
-}
-
-QVariant GeoRectangleValueType::value()
-{
- return QVariant::fromValue(QGeoRectangle(v));
-}
-
-void GeoRectangleValueType::write(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags flags)
-{
- QGeoRectangle r = v;
- writeProperty(obj, idx, flags, &r);
-}
-
-void GeoRectangleValueType::writeVariantValue(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags flags, QVariant *from)
-{
- if (from->userType() == qMetaTypeId<QGeoRectangle>()) {
- writeProperty(obj, idx, flags, from);
- } else if (from->userType() == qMetaTypeId<QGeoShape>()) {
- QGeoRectangle r = from->value<QGeoShape>();
- QVariant v = QVariant::fromValue(r);
- writeProperty(obj, idx, flags, &v);
- } else {
- QVariant v = QVariant::fromValue(QGeoRectangle());
- writeProperty(obj, idx, flags, &v);
- }
-}
-
-#include "moc_qdeclarativegeorectangle.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeorectangle.h b/src/imports/location/qdeclarativegeorectangle.h
deleted file mode 100644
index 98c93d79..00000000
--- a/src/imports/location/qdeclarativegeorectangle.h
+++ /dev/null
@@ -1,89 +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 QDECLARATIVEGEORECTANGLE_H
-#define QDECLARATIVEGEORECTANGLE_H
-
-#include "qdeclarativegeoshape.h"
-
-QT_BEGIN_NAMESPACE
-
-class GeoRectangleValueType : public GeoShapeValueType
-{
- Q_OBJECT
-
- Q_PROPERTY(QGeoCoordinate bottomLeft READ bottomLeft WRITE setBottomLeft)
- Q_PROPERTY(QGeoCoordinate bottomRight READ bottomRight WRITE setBottomRight)
- Q_PROPERTY(QGeoCoordinate topLeft READ topLeft WRITE setTopLeft)
- Q_PROPERTY(QGeoCoordinate topRight READ topRight WRITE setTopRight)
- Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter)
- Q_PROPERTY(double height READ height WRITE setHeight)
- Q_PROPERTY(double width READ width WRITE setWidth)
-
-public:
- explicit GeoRectangleValueType(QObject *parent = 0);
- ~GeoRectangleValueType();
-
- QGeoCoordinate bottomLeft();
- void setBottomLeft(const QGeoCoordinate &coordinate);
- QGeoCoordinate bottomRight();
- void setBottomRight(const QGeoCoordinate &coordinate);
- QGeoCoordinate topLeft();
- void setTopLeft(const QGeoCoordinate &coordinate);
- QGeoCoordinate topRight();
- void setTopRight(QGeoCoordinate &coordinate);
- QGeoCoordinate center();
- void setCenter(const QGeoCoordinate &coordinate);
- double height();
- void setHeight(double height);
- double width();
- void setWidth(double width);
-
- QString toString() const Q_DECL_OVERRIDE;
- void setValue(const QVariant &value) Q_DECL_OVERRIDE;
- QVariant value() Q_DECL_OVERRIDE;
- void write(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags flags) Q_DECL_OVERRIDE;
- void writeVariantValue(QObject *obj, int idx, QQmlPropertyPrivate::WriteFlags flags, QVariant *from) Q_DECL_OVERRIDE;
-};
-
-QT_END_NAMESPACE
-
-#endif
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/qdeclarativegeoshape.cpp b/src/imports/location/qdeclarativegeoshape.cpp
deleted file mode 100644
index e08f8edc..00000000
--- a/src/imports/location/qdeclarativegeoshape.cpp
+++ /dev/null
@@ -1,197 +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 "qdeclarativegeoshape.h"
-
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCircle>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlbasictype geoshape
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-basictypes
- \since Qt Location 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}.
-
- The \c 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
- geomatrical area of 0.
-
- The \l contains() method can be used to test if a \l {QtLocation::coordinate}{coordinate} is
- within the geoshape.
-
- \section2 Example Usage
-
- Use properties of type \l variant to store a \c {geoshape}. To create a \c geoshape use one
- of the methods described below.
-
- To create a \c geoshape value, specify it as a "shape()" string:
-
- \qml
- import QtLocation
-
- Item {
- property variant region: "shape()"
- }
- \endqml
-
- or with the \l {QtLocation::QtLocation}{QtLocation.shape()} function:
-
- \qml
- import QtLocation 5.0
-
- Item {
- property variant region: QtLocation.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 Methods
-
- \section3 contains()
-
- \code
- bool contains(coordinate coord)
- \endcode
-
- Returns true if the \l {QtLocation::coordinate}{coordinate} specified by \a coord is within
- this geoshape; Otherwise returns false.
-*/
-
-GeoShapeValueType::GeoShapeValueType(QObject *parent)
-: QQmlValueTypeBase<QGeoShape>(qMetaTypeId<QGeoShape>(), parent)
-{
-}
-
-GeoShapeValueType::~GeoShapeValueType()
-{
-}
-
-GeoShapeValueType::ShapeType GeoShapeValueType::type() const
-{
- return static_cast<GeoShapeValueType::ShapeType>(v.type());
-}
-
-bool GeoShapeValueType::isValid() const
-{
- return v.isValid();
-}
-
-bool GeoShapeValueType::isEmpty() const
-{
- return v.isEmpty();
-}
-
-bool GeoShapeValueType::contains(const QGeoCoordinate &coordinate) const
-{
- return v.contains(coordinate);
-}
-
-QString GeoShapeValueType::toString() const
-{
- switch (v.type()) {
- case QGeoShape::UnknownType:
- return QStringLiteral("QGeoShape()");
- case QGeoShape::RectangleType: {
- QGeoRectangle r = v;
- return QStringLiteral("QGeoRectangle({%1, %2}, {%3, %4})")
- .arg(r.topLeft().latitude())
- .arg(r.topLeft().longitude())
- .arg(r.bottomRight().latitude())
- .arg(r.bottomRight().longitude());
- }
- case QGeoShape::CircleType: {
- QGeoCircle c = v;
- return QStringLiteral("QGeoCircle({%1, %2}, %3)")
- .arg(c.center().latitude())
- .arg(c.center().longitude())
- .arg(c.radius());
- }
- }
-
- return QStringLiteral("QGeoShape(%1)").arg(v.type());
-}
-
-void GeoShapeValueType::setValue(const QVariant &value)
-{
- if (value.userType() == qMetaTypeId<QGeoShape>())
- v = value.value<QGeoShape>();
- else if (value.userType() == qMetaTypeId<QGeoRectangle>())
- v = value.value<QGeoRectangle>();
- else if (value.userType() == qMetaTypeId<QGeoCircle>())
- v = value.value<QGeoCircle>();
- else
- v = QGeoShape();
-
- onLoad();
-}
-
-bool GeoShapeValueType::isEqual(const QVariant &other) const
-{
- if (other.userType() == qMetaTypeId<QGeoShape>())
- return v == other.value<QGeoShape>();
- else if (other.userType() == qMetaTypeId<QGeoRectangle>())
- return v == other.value<QGeoRectangle>();
- else if (other.userType() == qMetaTypeId<QGeoCircle>())
- return v == other.value<QGeoCircle>();
- else
- return false;
-}
-
-GeoShapeValueType::GeoShapeValueType(int userType, QObject *parent)
-: QQmlValueTypeBase<QGeoShape>(userType, parent)
-{
- QMetaType::construct(userType, &v, 0);
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeoshape.h b/src/imports/location/qdeclarativegeoshape.h
deleted file mode 100644
index 9f0c16db..00000000
--- a/src/imports/location/qdeclarativegeoshape.h
+++ /dev/null
@@ -1,86 +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 QDECLARATIVEGEOSHAPE_H
-#define QDECLARATIVEGEOSHAPE_H
-
-#include <QtQml/private/qqmlvaluetype_p.h>
-#include <QtLocation/QGeoShape>
-
-QT_BEGIN_NAMESPACE
-
-class GeoShapeValueType : public QQmlValueTypeBase<QGeoShape>
-{
- Q_OBJECT
-
- Q_PROPERTY(ShapeType type READ type)
- Q_PROPERTY(bool isValid READ isValid)
- Q_PROPERTY(bool isEmpty READ isEmpty)
-
- Q_ENUMS(ShapeType)
-
-public:
- explicit GeoShapeValueType(QObject *parent = 0);
- ~GeoShapeValueType();
-
- enum ShapeType {
- UnknownType = QGeoShape::UnknownType,
- RectangleType = QGeoShape::RectangleType,
- CircleType = QGeoShape::CircleType
- };
-
- ShapeType type() const;
- bool isValid() const;
- bool isEmpty() const;
-
- Q_INVOKABLE bool contains(const QGeoCoordinate &coordinate) const;
-
- QString toString() const Q_DECL_OVERRIDE;
- void setValue(const QVariant &value) Q_DECL_OVERRIDE;
- bool isEqual(const QVariant &other) const Q_DECL_OVERRIDE;
-
-protected:
- explicit GeoShapeValueType(int userType, QObject *parent = 0);
-};
-
-QT_END_NAMESPACE
-
-#endif
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/qdeclarativeposition.cpp b/src/imports/location/qdeclarativeposition.cpp
deleted file mode 100644
index bbd53423..00000000
--- a/src/imports/location/qdeclarativeposition.cpp
+++ /dev/null
@@ -1,376 +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 "qdeclarativeposition_p.h"
-#include <QtQml/qqml.h>
-#include <qnmeapositioninfosource.h>
-#include <QFile>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype Position
- \instantiates QDeclarativePosition
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
-
- \brief The Position type holds positional data at a particular point in time,
- such as coordinate (longitude, latitude, altitude) and speed.
-
- The Position type holds values related to geographic location such as
- a \l coordinate (longitude, latitude, and altitude), the \l timestamp when
- the Position was obtained, the \l speed at that time, and the accuracy of
- the data.
-
- Primarily, it is used in the \l{PositionSource::position}{position} property
- of a \l{PositionSource}, as the basic unit of data available from the system
- location data source.
-
- Not all properties of a Position object are necessarily valid or available
- (for example latitude and longitude may be valid, but speed update has not been
- received or set manually). As a result, corresponding "valid" properties
- are available (for example \l{coordinate} and \l{longitudeValid}, \l{latitudeValid}
- etc) to discern whether the data is available and valid in this position
- update.
-
- Position objects are read-only and can only be produced by a PositionSource.
-
- \section2 Example Usage
-
- See the example given for the \l{PositionSource} type, or the
- \l{declarative/flickr}{Flickr} example application.
-
- \sa PositionSource, coordinate
-
-*/
-
-QDeclarativePosition::QDeclarativePosition(QObject *parent)
- : QObject(parent), m_latitudeValid(false), m_longitudeValid(false),
- m_altitudeValid(false), m_speed(-1), m_speedValid(false), m_horizontalAccuracyValid(false),
- m_verticalAccuracyValid(false), m_horizontalAccuracy(-1), m_verticalAccuracy(-1)
-{
-}
-
-QDeclarativePosition::~QDeclarativePosition()
-{
-}
-
-/*!
- \qmlproperty coordinate Position::coordinate
-
- This property holds the latitude, longitude, and altitude value of the Position.
-
- It is a read-only property.
-
- \sa longitudeValid, latitudeValid, altitudeValid
-*/
-
-void QDeclarativePosition::setCoordinate(const QGeoCoordinate &coordinate)
-{
- if (m_coordinate == coordinate)
- return;
-
- m_coordinate = coordinate;
-
- if (coordinate.type() == QGeoCoordinate::Coordinate3D && !m_altitudeValid) {
- m_altitudeValid = true;
- emit altitudeValidChanged();
- } else if (m_altitudeValid) {
- m_altitudeValid = false;
- emit altitudeValidChanged();
- }
- if (coordinate.isValid()) {
- if (!m_longitudeValid) {
- m_longitudeValid = true;
- emit longitudeValidChanged();
- }
- if (!m_latitudeValid) {
- m_latitudeValid = true;
- emit latitudeValidChanged();
- }
- } else {
- if (m_longitudeValid) {
- m_longitudeValid = false;
- emit longitudeValidChanged();
- }
- if (m_latitudeValid) {
- m_latitudeValid = false;
- emit latitudeValidChanged();
- }
- }
- emit coordinateChanged();
-}
-
-QGeoCoordinate QDeclarativePosition::coordinate()
-{
- return m_coordinate;
-}
-
-/*!
- \qmlproperty bool Position::latitudeValid
-
- This property is true if coordinate's latitude has been set
- (to indicate whether that data has been received or not, as every update
- does not necessarily contain all data).
-
- \sa coordinate
-
-*/
-
-bool QDeclarativePosition::isLatitudeValid() const
-{
- return m_latitudeValid;
-}
-
-
-/*!
- \qmlproperty bool Position::longitudeValid
-
- This property is true if coordinate's longitude has been set
- (to indicate whether that data has been received or not, as every update
- does not necessarily contain all data).
-
- \sa coordinate
-
-*/
-
-bool QDeclarativePosition::isLongitudeValid() const
-{
- return m_longitudeValid;
-}
-
-
-/*!
- \qmlproperty bool Position::speedValid
-
- This property is true if \l speed has been set
- (to indicate whether that data has been received or not, as every update
- does not necessarily contain all data).
-
- \sa speed
-
-*/
-
-bool QDeclarativePosition::isSpeedValid() const
-{
- return m_speedValid;
-}
-
-/*!
- \qmlproperty bool Position::altitudeValid
-
- This property is true if coordinate's altitude has been set
- (to indicate whether that data has been received or not, as every update
- does not necessarily contain all data).
-
- \sa coordinate
-
-*/
-
-bool QDeclarativePosition::isAltitudeValid() const
-{
- return m_altitudeValid;
-}
-
-/*!
- \qmlproperty double Position::speed
-
- This property holds the value of speed (groundspeed, meters / second).
-
- It is a read-only property.
-
- \sa speedValid, coordinate
-*/
-
-void QDeclarativePosition::setSpeed(double speed)
-{
- if (speed == m_speed)
- return;
- m_speed = speed;
- if (!m_speedValid) {
- m_speedValid = true;
- emit speedValidChanged();
- }
- emit speedChanged();
-}
-
-double QDeclarativePosition::speed() const
-{
- return m_speed;
-}
-
-/*!
- \qmlproperty real Position::horizontalAccuracy
-
- This property holds the horizontal accuracy of the coordinate (in meters).
-
- \sa horizontalAccuracyValid, coordinate
-*/
-
-void QDeclarativePosition::setHorizontalAccuracy(qreal horizontalAccuracy)
-{
- if (horizontalAccuracy == m_horizontalAccuracy)
- return;
- m_horizontalAccuracy = horizontalAccuracy;
- if (!m_horizontalAccuracyValid) {
- m_horizontalAccuracyValid = true;
- emit horizontalAccuracyValidChanged();
- }
- emit horizontalAccuracyChanged();
-}
-
-qreal QDeclarativePosition::horizontalAccuracy() const
-{
- return m_horizontalAccuracy;
-}
-
-/*!
- \qmlproperty bool Position::horizontalAccuracyValid
-
- This property is true if \l horizontalAccuracy has been set
- (to indicate whether that data has been received or not, as every update
- does not necessarily contain all data).
-
- \sa horizontalAccuracy
-
-*/
-
-bool QDeclarativePosition::isHorizontalAccuracyValid() const
-{
- return m_horizontalAccuracyValid;
-}
-
-/*!
- \qmlproperty real Position::verticalAccuracy
-
- This property holds the vertical accuracy of the coordinate (in meters).
-
- \sa verticalAccuracyValid, coordinate
-*/
-
-void QDeclarativePosition::setVerticalAccuracy(qreal verticalAccuracy)
-{
- if (verticalAccuracy == m_verticalAccuracy)
- return;
- m_verticalAccuracy = verticalAccuracy;
- if (!m_verticalAccuracyValid) {
- m_verticalAccuracyValid = true;
- emit verticalAccuracyValidChanged();
- }
- emit verticalAccuracyChanged();
-}
-
-qreal QDeclarativePosition::verticalAccuracy() const
-{
- return m_verticalAccuracy;
-}
-
-/*!
- \qmlproperty bool Position::verticalAccuracyValid
-
- This property is true if \l verticalAccuracy has been set
- (to indicate whether that data has been received or not, as every update
- does not necessarily contain all data).
-
- \sa verticalAccuracy
-
-*/
-
-bool QDeclarativePosition::isVerticalAccuracyValid() const
-{
- return m_verticalAccuracyValid;
-}
-
-/*!
- \qmlproperty date Position::timestamp
-
- This property holds the timestamp when this position
- was received. If the property has not been set, it is invalid.
-
- It is a read-only property.
-*/
-
-void QDeclarativePosition::setTimestamp(const QDateTime &timestamp)
-{
- if (timestamp == m_timestamp)
- return;
- m_timestamp = timestamp;
- emit timestampChanged();
-}
-
-QDateTime QDeclarativePosition::timestamp() const
-{
- return m_timestamp;
-}
-
-void QDeclarativePosition::invalidate()
-{
- // Invalidate all data
- if (m_latitudeValid) {
- m_latitudeValid = false;
- emit latitudeValidChanged();
- }
- if (m_longitudeValid) {
- m_longitudeValid = false;
- emit longitudeValidChanged();
- }
- if (m_altitudeValid) {
- m_altitudeValid = false;
- emit altitudeValidChanged();
- }
- if (m_speedValid) {
- m_speedValid = false;
- emit speedValidChanged();
- }
- if (m_horizontalAccuracyValid) {
- m_horizontalAccuracyValid = false;
- emit horizontalAccuracyValidChanged();
- }
- if (m_verticalAccuracyValid) {
- m_verticalAccuracyValid = false;
- emit verticalAccuracyValidChanged();
- }
-}
-
-#include "moc_qdeclarativeposition_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativeposition_p.h b/src/imports/location/qdeclarativeposition_p.h
deleted file mode 100644
index bf424176..00000000
--- a/src/imports/location/qdeclarativeposition_p.h
+++ /dev/null
@@ -1,132 +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 QDECLARATIVEPOSITION_H
-#define QDECLARATIVEPOSITION_H
-
-#include <QtCore>
-#include <QDateTime>
-#include <qgeopositioninfosource.h>
-#include <qgeopositioninfo.h>
-#include "qdeclarativecoordinate_p.h"
-#include <QtQml/qqml.h>
-
-// Define this to get qDebug messages
-// #define QDECLARATIVE_POSITION_DEBUG
-
-#ifdef QDECLARATIVE_POSITION_DEBUG
-#include <QDebug>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativePosition : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(bool latitudeValid READ isLatitudeValid NOTIFY latitudeValidChanged)
- Q_PROPERTY(bool longitudeValid READ isLongitudeValid NOTIFY longitudeValidChanged)
- Q_PROPERTY(bool altitudeValid READ isAltitudeValid NOTIFY altitudeValidChanged)
- Q_PROPERTY(QGeoCoordinate coordinate READ coordinate NOTIFY coordinateChanged)
- Q_PROPERTY(QDateTime timestamp READ timestamp NOTIFY timestampChanged)
- Q_PROPERTY(double speed READ speed NOTIFY speedChanged)
- Q_PROPERTY(bool speedValid READ isSpeedValid NOTIFY speedValidChanged)
- Q_PROPERTY(qreal horizontalAccuracy READ horizontalAccuracy WRITE setHorizontalAccuracy NOTIFY horizontalAccuracyChanged)
- Q_PROPERTY(qreal verticalAccuracy READ verticalAccuracy WRITE setVerticalAccuracy NOTIFY verticalAccuracyChanged)
- Q_PROPERTY(bool horizontalAccuracyValid READ isHorizontalAccuracyValid NOTIFY horizontalAccuracyValidChanged)
- Q_PROPERTY(bool verticalAccuracyValid READ isVerticalAccuracyValid NOTIFY verticalAccuracyValidChanged)
-
-public:
-
- explicit QDeclarativePosition(QObject *parent = 0);
- ~QDeclarativePosition();
-
- bool isLatitudeValid() const;
- bool isLongitudeValid() const;
- bool isAltitudeValid() const;
- QDateTime timestamp() const;
- void setTimestamp(const QDateTime &timestamp);
- double speed() const;
- void setSpeed(double speed);
- bool isSpeedValid() const;
- QGeoCoordinate coordinate();
- bool isHorizontalAccuracyValid() const;
- qreal horizontalAccuracy() const;
- void setHorizontalAccuracy(qreal horizontalAccuracy);
- bool isVerticalAccuracyValid() const;
- qreal verticalAccuracy() const;
- void setVerticalAccuracy(qreal verticalAccuracy);
-
- // C++
- void setCoordinate(const QGeoCoordinate &coordinate);
- void invalidate();
-
-Q_SIGNALS:
- void latitudeValidChanged();
- void longitudeValidChanged();
- void altitudeValidChanged();
- void timestampChanged();
- void speedChanged();
- void speedValidChanged();
- void coordinateChanged();
- void horizontalAccuracyChanged();
- void horizontalAccuracyValidChanged();
- void verticalAccuracyChanged();
- void verticalAccuracyValidChanged();
-
-private:
- bool m_latitudeValid;
- bool m_longitudeValid;
- bool m_altitudeValid;
- QDateTime m_timestamp;
- double m_speed;
- bool m_speedValid;
- bool m_horizontalAccuracyValid;
- bool m_verticalAccuracyValid;
- qreal m_horizontalAccuracy;
- qreal m_verticalAccuracy;
- QGeoCoordinate m_coordinate;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativePosition)
-
-#endif
diff --git a/src/imports/location/qdeclarativepositionsource.cpp b/src/imports/location/qdeclarativepositionsource.cpp
deleted file mode 100644
index d4605a42..00000000
--- a/src/imports/location/qdeclarativepositionsource.cpp
+++ /dev/null
@@ -1,647 +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 "qdeclarativepositionsource_p.h"
-#include "qdeclarativeposition_p.h"
-#include "error_messages.h"
-
-#include <QtQml/qqmlinfo.h>
-#include <QtQml/qqml.h>
-#include <qnmeapositioninfosource.h>
-#include <QFile>
-#include <QTimer>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype PositionSource
- \instantiates QDeclarativePositionSource
- \inqmlmodule QtLocation 5.0
- \ingroup qml-QtLocation5-positioning
- \since Qt Location 5.0
-
- \brief The PositionSource type provides the device's current position.
-
- The PositionSource type provides information about the user device's
- current position. The position is available as a \l{Position} type, which
- contains all the standard parameters typically available from GPS and other
- similar systems, including longitude, latitude, speed and accuracy details.
-
- As different position sources are available on different platforms and
- devices, these are categorized by their basic type (Satellite, NonSatellite,
- and AllPositioningMethods). The available methods for the current platform
- can be enumerated in the \l{supportedPositioningMethods} property.
-
- To indicate which methods are suitable for your application, set the
- \l{preferredPositioningMethods} property. If the preferred methods are not
- available, the default source of location data for the platform will be
- chosen instead. If no default source is available (because none are installed
- for the runtime platform, or because it is disabled), the \l{valid} property
- will be set to false.
-
- The \l updateInterval property can then be used to indicate how often your
- application wishes to receive position updates. The \l{start}(),
- \l{stop}() and \l{update}() methods can be used to control the operation
- of the PositionSource, as well as the \l{active} property, which when set
- is equivalent to calling \l{start}() or \l{stop}().
-
- When the PositionSource is active, position updates can be retrieved
- either by simply using the \l{position} property in a binding (as the
- value of another item's property), or by providing an implementation of
- the \c {onPositionChanged} signal-handler.
-
- \section2 Example Usage
-
- The following example shows a simple PositionSource used to receive
- updates every second and print the longitude and latitude out to
- the console.
-
- \code
- PositionSource {
- id: src
- updateInterval: 1000
- active: true
-
- onPositionChanged: {
- var coord = src.position.coordinate;
- console.log("Coordinate:", coord.longitude, coord.latitude);
- }
- }
- \endcode
-
- The \l{declarative/flickr}{Flickr} example application shows how to use
- a PositionSource in your application to retrieve local data for users
- from a REST web service.
-
- \sa {QtLocation5::Position}, {QGeoPositionInfoSource}
-
-*/
-
-QDeclarativePositionSource::QDeclarativePositionSource()
-: m_positionSource(0), m_preferredPositioningMethods(NoPositioningMethod), m_nmeaFile(0),
- m_active(false), m_singleUpdate(false), m_updateInterval(0), m_sourceError(UnknownSourceError)
-{
-}
-
-QDeclarativePositionSource::~QDeclarativePositionSource()
-{
- delete m_nmeaFile;
- delete m_positionSource;
-}
-
-
-/*!
- \qmlproperty string PositionSource::name
-
- This property holds the unique internal name for the plugin currently
- providing position information.
-
- Setting the property causes the PositionSource to use a particular positioning provider. If
- the PositionSource is active at the time that the name property is changed, it will become
- inactive. If the specified positioning provider cannot be loaded the position source will
- become invalid.
-
- Changing the name property may cause the \l {updateInterval}, \l {supportedPositioningMethods}
- and \l {preferredPositioningMethods} properties to change as well.
-*/
-
-
-QString QDeclarativePositionSource::name() const
-{
- if (m_positionSource)
- return m_positionSource->sourceName();
- else
- return QString();
-}
-
-void QDeclarativePositionSource::setName(const QString &newName)
-{
- if (m_positionSource && m_positionSource->sourceName() == newName)
- return;
-
- const QString previousName = name();
- int previousUpdateInterval = updateInterval();
- PositioningMethods previousPositioningMethods = supportedPositioningMethods();
- PositioningMethods previousPreferredPositioningMethods = preferredPositioningMethods();
-
- delete m_positionSource;
- if (newName.isEmpty())
- m_positionSource = QGeoPositionInfoSource::createDefaultSource(this);
- else
- m_positionSource = QGeoPositionInfoSource::createSource(newName, this);
-
- if (m_positionSource) {
- connect(m_positionSource, SIGNAL(positionUpdated(QGeoPositionInfo)),
- this, SLOT(positionUpdateReceived(QGeoPositionInfo)));
- connect(m_positionSource, SIGNAL(error(QGeoPositionInfoSource::Error)),
- this, SLOT(sourceErrorReceived(QGeoPositionInfoSource::Error)));
-
- m_positionSource->setUpdateInterval(m_updateInterval);
- m_positionSource->setPreferredPositioningMethods(
- static_cast<QGeoPositionInfoSource::PositioningMethods>(int(m_preferredPositioningMethods)));
- }
-
- if (previousUpdateInterval != updateInterval())
- emit updateIntervalChanged();
-
- if (previousPreferredPositioningMethods != preferredPositioningMethods())
- emit preferredPositioningMethodsChanged();
-
- if (previousPositioningMethods != supportedPositioningMethods())
- emit supportedPositioningMethodsChanged();
-
- emit validityChanged();
-
- if (m_active) {
- m_active = false;
- emit activeChanged();
- }
-
- if (previousName != name())
- emit nameChanged();
-}
-
-/*!
- \qmlproperty bool PositionSource::valid
-
- This property is true if the PositionSource object has acquired a valid
- backend plugin to provide data. If false, other methods on the PositionSource
- will have no effect.
-
- Applications should check this property to determine whether positioning is
- available and enabled on the runtime platform, and react accordingly.
-*/
-bool QDeclarativePositionSource::isValid() const
-{
- return (m_positionSource != 0);
-}
-
-/*!
- \internal
-*/
-void QDeclarativePositionSource::setNmeaSource(const QUrl &nmeaSource)
-{
- // Strip the filename. This is clumsy but the file may be prefixed in several
- // ways: "file:///", "qrc:///", "/", "" in platform dependant manner.
- QString localFileName = nmeaSource.toString();
- if (!QFile::exists(localFileName)) {
- if (localFileName.startsWith("qrc:///")) {
- localFileName.remove(0, 7);
- } else if (localFileName.startsWith("file:///")) {
- localFileName.remove(0, 7);
- }
- if (!QFile::exists(localFileName) && localFileName.startsWith("/")) {
- localFileName.remove(0,1);
- }
- }
- if (m_nmeaFileName == localFileName)
- return;
- m_nmeaFileName = localFileName;
- m_nmeaSource = nmeaSource;
-
- PositioningMethods previousPositioningMethods = supportedPositioningMethods();
-
- // The current position source needs to be deleted
- // because QNmeaPositionInfoSource can be bound only to a one file.
- delete m_positionSource;
- m_positionSource = 0;
- // Create the NMEA source based on the given data. QML has automatically set QUrl
- // type to point to correct path. If the file is not found, check if the file actually
- // was an embedded resource file.
- delete m_nmeaFile;
- m_nmeaFile = new QFile(localFileName);
- if (!m_nmeaFile->exists()) {
- localFileName.prepend(":");
- m_nmeaFile->setFileName(localFileName);
- }
- if (m_nmeaFile->exists()) {
-#ifdef QDECLARATIVE_POSITION_DEBUG
- qDebug() << "QDeclarativePositionSource NMEA File was found: " << localFileName;
-#endif
- m_positionSource = new QNmeaPositionInfoSource(QNmeaPositionInfoSource::SimulationMode);
- (qobject_cast<QNmeaPositionInfoSource *>(m_positionSource))->setDevice(m_nmeaFile);
- connect(m_positionSource, SIGNAL(positionUpdated(QGeoPositionInfo)),
- this, SLOT(positionUpdateReceived(QGeoPositionInfo)));
- if (m_active && !m_singleUpdate) {
- // Keep on updating even though source changed
- QTimer::singleShot(0, this, SLOT(start()));
- }
- } else {
- qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, MISSED_NMEA_FILE) << localFileName;
-#ifdef QDECLARATIVE_POSITION_DEBUG
- qDebug() << "QDeclarativePositionSource NMEA File was not found: " << localFileName;
-#endif
- if (m_active) {
- m_active = false;
- m_singleUpdate = false;
- emit activeChanged();
- }
- }
-
- if (previousPositioningMethods != supportedPositioningMethods())
- emit supportedPositioningMethodsChanged();
-
- emit nmeaSourceChanged();
-}
-
-/*!
- \internal
-*/
-void QDeclarativePositionSource::setUpdateInterval(int updateInterval)
-{
- if (m_positionSource) {
- int previousUpdateInterval = m_positionSource->updateInterval();
-
- m_updateInterval = updateInterval;
-
- if (previousUpdateInterval != updateInterval) {
- m_positionSource->setUpdateInterval(updateInterval);
- if (previousUpdateInterval != m_positionSource->updateInterval())
- emit updateIntervalChanged();
- }
- } else {
- if (m_updateInterval != updateInterval) {
- m_updateInterval = updateInterval;
- emit updateIntervalChanged();
- }
- }
-}
-
-/*!
- \qmlproperty url PositionSource::nmeaSource
-
- This property holds the source for NMEA (National Marine Electronics Association)
- position-specification data (file). One purpose of this property is to be of
- development convenience.
-
- Setting this property will override any other position source. Currently only
- files local to the .qml -file are supported. The NMEA source is created in simulation mode,
- meaning that the data and time information in the NMEA source data is used to provide
- positional updates at the rate at which the data was originally recorded.
-
- If nmeaSource has been set for a PositionSource object, there is no way to revert
- back to non-file sources.
-*/
-
-QUrl QDeclarativePositionSource::nmeaSource() const
-{
- return m_nmeaSource;
-}
-
-/*!
- \qmlproperty int PositionSource::updateInterval
-
- This property holds the desired interval between updates (milliseconds).
-
- \sa {QGeoPositionInfoSource::updateInterval()}
-*/
-
-int QDeclarativePositionSource::updateInterval() const
-{
- if (!m_positionSource)
- return m_updateInterval;
-
- return m_positionSource->updateInterval();
-}
-
-/*!
- \qmlproperty enumeration PositionSource::supportedPositioningMethods
-
- This property holds the supported positioning methods of the
- current source.
-
- \list
- \li PositionSource.NoPositioningMethod - No positioning methods supported (no source).
- \li PositionSource.SatellitePositioningMethod - Satellite-based positioning methods such as GPS are supported.
- \li PositionSource.NonSatellitePositioningMethod - Non-satellite-based methods are supported.
- \li PositionSource.AllPositioningMethods - Both satellite-based and non-satellite positioning methods are supported.
- \endlist
-
-*/
-
-QDeclarativePositionSource::PositioningMethods QDeclarativePositionSource::supportedPositioningMethods() const
-{
- if (m_positionSource) {
- QGeoPositionInfoSource::PositioningMethods methods = m_positionSource->supportedPositioningMethods();
- if ( (methods & QGeoPositionInfoSource::AllPositioningMethods) == methods ) {
- return QDeclarativePositionSource::AllPositioningMethods;
- } else if (methods & QGeoPositionInfoSource::SatellitePositioningMethods) {
- return QDeclarativePositionSource::SatellitePositioningMethod;
- } else if (methods & QGeoPositionInfoSource::NonSatellitePositioningMethods) {
- return QDeclarativePositionSource::NonSatellitePositioningMethod;
- }
- }
- return QDeclarativePositionSource::NoPositioningMethod;
-}
-
-/*!
- \qmlproperty enumeration PositionSource::preferredPositioningMethods
-
- This property holds the preferred positioning methods of the
- current source.
-
- \list
- \li PositionSource.SatellitePositioningMethod - Satellite-based positioning methods such as GPS should be preferred.
- \li PositionSource.NonSatellitePositioningMethod - Non-satellite-based methods should be preferred.
- \li PositionSource.AllPositioningMethods - Any positioning methods are acceptable.
- \endlist
-
-*/
-
-void QDeclarativePositionSource::setPreferredPositioningMethods(PositioningMethods methods)
-{
- if (m_positionSource) {
- PositioningMethods previousPreferredPositioningMethods = preferredPositioningMethods();
-
- m_preferredPositioningMethods = methods;
-
- if (previousPreferredPositioningMethods != methods) {
- m_positionSource->setPreferredPositioningMethods(
- static_cast<QGeoPositionInfoSource::PositioningMethods>(int(methods)));
- if (previousPreferredPositioningMethods != m_positionSource->preferredPositioningMethods())
- emit preferredPositioningMethodsChanged();
- }
- } else {
- if (m_preferredPositioningMethods != methods) {
- m_preferredPositioningMethods = methods;
- emit preferredPositioningMethodsChanged();
- }
- }
-}
-
-QDeclarativePositionSource::PositioningMethods QDeclarativePositionSource::preferredPositioningMethods() const
-{
- if (m_positionSource) {
- QGeoPositionInfoSource::PositioningMethods methods =
- m_positionSource->preferredPositioningMethods();
- if ( (methods & QGeoPositionInfoSource::AllPositioningMethods) == methods) {
- return QDeclarativePositionSource::AllPositioningMethods;
- } else if (methods & QGeoPositionInfoSource::SatellitePositioningMethods) {
- return QDeclarativePositionSource::SatellitePositioningMethod;
- } else if (methods & QGeoPositionInfoSource::NonSatellitePositioningMethods) {
- return QDeclarativePositionSource::NonSatellitePositioningMethod;
- }
- }
- return m_preferredPositioningMethods;
-}
-
-/*!
- \qmlmethod PositionSource::start()
-
- Requests updates from the location source.
- Uses \l updateInterval if set, default interval otherwise.
- If there is no source available, this method has no effect.
-
- \sa stop, update, active
-*/
-
-void QDeclarativePositionSource::start()
-{
- if (!m_positionSource)
- return;
-
- m_positionSource->startUpdates();
- if (!m_active) {
- m_active = true;
- emit activeChanged();
- }
-}
-
-/*!
- \qmlmethod PositionSource::update()
-
- A convenience method to request single update from the location source.
- If there is no source available, this method has no effect.
-
- If the position source is not active, it will be activated for as
- long as it takes to receive an update, or until the request times
- out. The request timeout period is source-specific.
-
- \sa start, stop, active
-*/
-
-void QDeclarativePositionSource::update()
-{
- if (m_positionSource) {
- if (!m_active) {
- m_active = true;
- m_singleUpdate = true;
- emit activeChanged();
- }
- // Use default timeout value. Set active before calling the
- // update request because on some platforms there may
- // be results immediately.
- m_positionSource->requestUpdate();
- }
-}
-
-/*!
- \qmlmethod PositionSource::stop()
-
- Stops updates from the location source.
- If there is no source available or it is not active,
- this method has no effect.
-
- \sa start, update, active
-*/
-
-void QDeclarativePositionSource::stop()
-{
- if (m_positionSource) {
- m_positionSource->stopUpdates();
- if (m_active) {
- m_active = false;
- emit activeChanged();
- }
- }
-}
-
-/*!
- \qmlproperty bool PositionSource::active
-
- This property indicates whether the position source is active.
- Setting this property to false equals calling \l stop, and
- setting this property true equals calling \l start.
-
- \sa start, stop, update
-*/
-void QDeclarativePositionSource::setActive(bool active)
-{
- if (active == m_active)
- return;
-
- if (active)
- QTimer::singleShot(0, this, SLOT(start())); // delay ensures all properties have been set
- else
- stop();
-}
-
-bool QDeclarativePositionSource::isActive() const
-{
- return m_active;
-}
-
-/*!
- \qmlproperty Position PositionSource::position
-
- This property holds the last known positional data.
- It is a read-only property.
-
- The Position type has different positional member variables,
- whose validity can be checked with appropriate validity functions
- (for example sometimes an update does not have speed or altitude data).
-
- However, whenever a \c {positionChanged} signal has been received, at least
- position::coordinate::latitude, position::coordinate::longitude, and position::timestamp can
- be assumed to be valid.
-
- \sa start, stop, update
-*/
-
-QDeclarativePosition *QDeclarativePositionSource::position()
-{
- return &m_position;
-}
-
-void QDeclarativePositionSource::positionUpdateReceived(const QGeoPositionInfo &update)
-{
- if (update.isValid()) {
- m_position.setTimestamp(update.timestamp());
- m_position.setCoordinate(update.coordinate());
- if (update.hasAttribute(QGeoPositionInfo::GroundSpeed)) {
- m_position.setSpeed(update.attribute(QGeoPositionInfo::GroundSpeed));
- }
- if (update.hasAttribute(QGeoPositionInfo::HorizontalAccuracy)) {
- m_position.setHorizontalAccuracy(update.attribute(QGeoPositionInfo::HorizontalAccuracy));
- }
- if (update.hasAttribute(QGeoPositionInfo::VerticalAccuracy)) {
- m_position.setVerticalAccuracy(update.attribute(QGeoPositionInfo::VerticalAccuracy));
- }
- emit positionChanged();
- } else {
- m_position.invalidate();
- }
- if (m_singleUpdate && m_active) {
- m_active = false;
- m_singleUpdate = false;
- emit activeChanged();
- }
-}
-
-
-/*!
- \qmlproperty enumeration PositionSource::sourceError
-
- This property holds the error which last occured with the PositionSource.
-
- \list
- \li PositionSource.AccessError - The connection setup to the remote positioning backend failed because the
- application lacked the required privileges.
- \li PositionSource.ClosedError - The remote positioning backend closed the connection, which happens for example in case
- the user is switching location services to off. This object becomes invalid and should be deleted.
- A new source can be declared later on to check whether the positioning backend is up again.
- \li PositionSource.UnknownSourceError - An unidentified error occurred.
- \endlist
-
-*/
-
-QDeclarativePositionSource::SourceError QDeclarativePositionSource::sourceError() const
-{
- return m_sourceError;
-}
-
-void QDeclarativePositionSource::componentComplete()
-{
- if (!m_positionSource) {
- int previousUpdateInterval = updateInterval();
- PositioningMethods previousPositioningMethods = supportedPositioningMethods();
- PositioningMethods previousPreferredPositioningMethods = preferredPositioningMethods();
-
- m_positionSource = QGeoPositionInfoSource::createDefaultSource(this);
- if (m_positionSource) {
- connect(m_positionSource, SIGNAL(positionUpdated(QGeoPositionInfo)),
- this, SLOT(positionUpdateReceived(QGeoPositionInfo)));
- connect(m_positionSource, SIGNAL(error(QGeoPositionInfoSource::Error)),
- this, SLOT(sourceErrorReceived(QGeoPositionInfoSource::Error)));
-
- m_positionSource->setUpdateInterval(m_updateInterval);
- m_positionSource->setPreferredPositioningMethods(
- static_cast<QGeoPositionInfoSource::PositioningMethods>(int(m_preferredPositioningMethods)));
- }
-
- if (previousUpdateInterval != updateInterval())
- emit updateIntervalChanged();
-
- if (previousPreferredPositioningMethods != preferredPositioningMethods())
- emit preferredPositioningMethodsChanged();
-
- if (previousPositioningMethods != supportedPositioningMethods())
- emit supportedPositioningMethodsChanged();
-
- emit validityChanged();
-
- if (m_active) {
- m_active = false;
- emit activeChanged();
- }
-
- emit nameChanged();
- }
-}
-
-/*!
- \internal
-*/
-void QDeclarativePositionSource::sourceErrorReceived(const QGeoPositionInfoSource::Error error)
-{
- if (error == QGeoPositionInfoSource::AccessError) {
- m_sourceError = QDeclarativePositionSource::AccessError;
- } else if (error == QGeoPositionInfoSource::ClosedError) {
- m_sourceError = QDeclarativePositionSource::ClosedError;
- } else {
- m_sourceError = QDeclarativePositionSource::UnknownSourceError;
- }
- emit sourceErrorChanged();
-}
-
-#include "moc_qdeclarativepositionsource_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativepositionsource_p.h b/src/imports/location/qdeclarativepositionsource_p.h
deleted file mode 100644
index dea18b62..00000000
--- a/src/imports/location/qdeclarativepositionsource_p.h
+++ /dev/null
@@ -1,150 +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 QDECLARATIVEPOSITIONSOURCE_H
-#define QDECLARATIVEPOSITIONSOURCE_H
-
-#include "qdeclarativeposition_p.h"
-
-#include <QtCore/QObject>
-#include <QtQml/QQmlParserStatus>
-#include <QtLocation/QGeoPositionInfoSource>
-
-QT_BEGIN_NAMESPACE
-
-class QFile;
-
-class QDeclarativePositionSource : public QObject, public QQmlParserStatus
-{
- Q_OBJECT
-
- Q_PROPERTY(QDeclarativePosition *position READ position NOTIFY positionChanged)
- Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
- Q_PROPERTY(bool valid READ isValid NOTIFY validityChanged)
- Q_PROPERTY(QUrl nmeaSource READ nmeaSource WRITE setNmeaSource NOTIFY nmeaSourceChanged)
- Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval NOTIFY updateIntervalChanged)
- Q_PROPERTY(PositioningMethods supportedPositioningMethods READ supportedPositioningMethods NOTIFY supportedPositioningMethodsChanged)
- Q_PROPERTY(PositioningMethods preferredPositioningMethods READ preferredPositioningMethods WRITE setPreferredPositioningMethods NOTIFY preferredPositioningMethodsChanged)
- Q_PROPERTY(SourceError sourceError READ sourceError NOTIFY sourceErrorChanged)
- Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
- Q_ENUMS(PositioningMethod)
-
- Q_INTERFACES(QQmlParserStatus)
-
-public:
- enum PositioningMethod {
- NoPositioningMethod = 0,
- SatellitePositioningMethod = QGeoPositionInfoSource::SatellitePositioningMethods,
- NonSatellitePositioningMethod = QGeoPositionInfoSource::NonSatellitePositioningMethods,
- AllPositioningMethods = QGeoPositionInfoSource::AllPositioningMethods
- };
-
- Q_DECLARE_FLAGS(PositioningMethods, PositioningMethod)
- Q_FLAGS(PositioningMethods)
-
- enum SourceError {
- AccessError = QGeoPositionInfoSource::AccessError,
- ClosedError = QGeoPositionInfoSource::ClosedError,
- UnknownSourceError = QGeoPositionInfoSource::UnknownSourceError
- };
- Q_ENUMS(SourceError)
-
- QDeclarativePositionSource();
- ~QDeclarativePositionSource();
- void setNmeaSource(const QUrl &nmeaSource);
- void setUpdateInterval(int updateInterval);
- void setActive(bool active);
- void setPreferredPositioningMethods(PositioningMethods methods);
-
- QString name() const;
- void setName(const QString &name);
-
- QUrl nmeaSource() const;
- int updateInterval() const;
- bool isActive() const;
- bool isValid() const;
- QDeclarativePosition *position();
- PositioningMethods supportedPositioningMethods() const;
- PositioningMethods preferredPositioningMethods() const;
- SourceError sourceError() const;
-
- // Virtuals from QQmlParserStatus
- void classBegin() { }
- void componentComplete();
-
-public Q_SLOTS:
- void update();
- void start();
- void stop();
-
-Q_SIGNALS:
- void positionChanged();
- void activeChanged();
- void nmeaSourceChanged();
- void updateIntervalChanged();
- void supportedPositioningMethodsChanged();
- void preferredPositioningMethodsChanged();
- void sourceErrorChanged();
- void nameChanged();
- void validityChanged();
-
-
-private Q_SLOTS:
- void positionUpdateReceived(const QGeoPositionInfo &update);
- void sourceErrorReceived(const QGeoPositionInfoSource::Error error);
-private:
- QGeoPositionInfoSource *m_positionSource;
- QDeclarativePosition m_position;
- PositioningMethods m_preferredPositioningMethods;
- QFile *m_nmeaFile;
- QString m_nmeaFileName;
- QUrl m_nmeaSource;
- bool m_active;
- bool m_singleUpdate;
- int m_updateInterval;
- SourceError m_sourceError;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativePositionSource)
-
-#endif
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>