summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-21 20:12:21 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-27 20:58:49 +0200
commit5e1cab609b1465669c519f1cdb3bdd2c9cd43eda (patch)
treeb142acabadcbf2c5e9df9be1385610aa9ad97317
parentcc505ad3e77cb26467262bc71c199ce0b12f9be6 (diff)
Remove turn-by-turn navigation
It is unfinished and untested, with no support from any backend. This was the last bit of functionality in the labs module, so remove that entirely, including the QML plugin and the now unused QParameterizableObject type. Change-Id: Ic448e643cb345d1da877137a673ab572c836b3fe Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit df7fddf600bed1dab77299b02c0bc98bb540bc28) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/imports/CMakeLists.txt3
-rw-r--r--src/imports/locationlabs/CMakeLists.txt12
-rw-r--r--src/imports/locationlabs/locationlabs.cpp77
-rw-r--r--src/location/CMakeLists.txt10
-rw-r--r--src/location/declarativemaps/qparameterizableobject.cpp121
-rw-r--r--src/location/declarativemaps/qparameterizableobject_p.h102
-rw-r--r--src/location/labs/qdeclarativenavigator.cpp773
-rw-r--r--src/location/labs/qdeclarativenavigator_p.h195
-rw-r--r--src/location/labs/qdeclarativenavigator_p_p.h210
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp28
-rw-r--r--src/location/maps/qgeoserviceprovider.h3
-rw-r--r--src/location/maps/qgeoserviceprovider_p.h1
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.cpp25
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.h3
-rw-r--r--src/location/maps/qnavigationmanager.cpp125
-rw-r--r--src/location/maps/qnavigationmanager_p.h104
-rw-r--r--src/location/maps/qnavigationmanagerengine.cpp219
-rw-r--r--src/location/maps/qnavigationmanagerengine_p.h168
18 files changed, 0 insertions, 2179 deletions
diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt
index 060cbd1e..725edc35 100644
--- a/src/imports/CMakeLists.txt
+++ b/src/imports/CMakeLists.txt
@@ -1,4 +1 @@
add_subdirectory(location)
-if(QT_FEATURE_location_labs_plugin)
- add_subdirectory(locationlabs)
-endif()
diff --git a/src/imports/locationlabs/CMakeLists.txt b/src/imports/locationlabs/CMakeLists.txt
deleted file mode 100644
index ba85ec28..00000000
--- a/src/imports/locationlabs/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-qt_internal_add_qml_module(locationlabsplugin
- URI Qt.labs.location
- VERSION ${PROJECT_VERSION}
- PLUGIN_TARGET locationlabsplugin
- NO_GENERATE_PLUGIN_SOURCE
- NO_PLUGIN_OPTIONAL
- CLASS_NAME QtLocationLabsDeclarativeModule
- SOURCES
- locationlabs.cpp
- LIBRARIES
- Qt::LocationPrivate
-)
diff --git a/src/imports/locationlabs/locationlabs.cpp b/src/imports/locationlabs/locationlabs.cpp
deleted file mode 100644
index 78d8d1b0..00000000
--- a/src/imports/locationlabs/locationlabs.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtLocation/private/qdeclarativenavigator_p.h>
-#include <QtLocation/private/qdeclarativenavigator_p_p.h>
-#include <QtLocation/private/qnavigationmanagerengine_p.h>
-#include <QtQml/qqmlextensionplugin.h>
-#include <QtQml/qqml.h>
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-class QtLocationLabsDeclarativeModule: public QQmlExtensionPlugin
-{
- Q_OBJECT
-
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-
-public:
- QtLocationLabsDeclarativeModule(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { }
- void registerTypes(const char *uri) override
- {
- if (QLatin1String(uri) == QLatin1String("Qt.labs.location")) {
-
- // @uri QtLocationLabs
- int major = 1;
- int minor = 0;
-
- // Register the 1.0 labs types
- qmlRegisterAnonymousType<QDeclarativeNavigationBasicDirections>(uri, major);
- qmlRegisterType<QDeclarativeNavigator>(uri, major, minor, "Navigator");
- qmlRegisterAnonymousType<QAbstractNavigator>(uri, major);
- } else {
- qDebug() << "Unsupported URI given to load location QML plugin: " << QLatin1String(uri);
- }
- }
-};
-
-QT_END_NAMESPACE
-
-#include "locationlabs.moc"
diff --git a/src/location/CMakeLists.txt b/src/location/CMakeLists.txt
index b8725b16..341129c0 100644
--- a/src/location/CMakeLists.txt
+++ b/src/location/CMakeLists.txt
@@ -42,8 +42,6 @@ qt_internal_add_module(Location
maps/qgeomapparameter_p.h maps/qgeomapparameter.cpp
maps/qgeoprojection_p.h maps/qgeoprojection.cpp
maps/qgeojson_p.h maps/qgeojson.cpp
- maps/qnavigationmanagerengine_p.h maps/qnavigationmanagerengine.cpp
- maps/qnavigationmanager_p.h maps/qnavigationmanager.cpp
places/qplacemanager.h places/qplacemanager.cpp
places/qplacemanagerengine.h places/qplacemanagerengine_p.h places/qplacemanagerengine.cpp
places/unsupportedreplies_p.h
@@ -79,7 +77,6 @@ qt_internal_add_module(Location
declarativemaps/qdeclarativegeomaptype_p.h declarativemaps/qdeclarativegeomaptype.cpp
declarativemaps/qdeclarativegeomapparameter_p.h
declarativemaps/qdeclarativegeomapparameter.cpp
- declarativemaps/qparameterizableobject_p.h declarativemaps/qparameterizableobject.cpp
declarativemaps/error_messages.cpp declarativemaps/error_messages_p.h
declarativemaps/locationvaluetypehelper.cpp declarativemaps/locationvaluetypehelper_p.h
declarativemaps/qdeclarativegeocodemodel.cpp declarativemaps/qdeclarativegeocodemodel_p.h
@@ -179,13 +176,6 @@ qt_internal_add_module(Location
QT_NO_FOREACH
)
-qt_internal_extend_target(Location CONDITION QT_FEATURE_location_labs_plugin
- SOURCES
- labs/qdeclarativenavigator.cpp labs/qdeclarativenavigator_p.h labs/qdeclarativenavigator_p_p.h
- INCLUDE_DIRECTORIES
- labs
-)
-
qt_internal_add_shaders(Location "declarative_location_shaders"
BATCHABLE
PRECOMPILE
diff --git a/src/location/declarativemaps/qparameterizableobject.cpp b/src/location/declarativemaps/qparameterizableobject.cpp
deleted file mode 100644
index 7a5bcae8..00000000
--- a/src/location/declarativemaps/qparameterizableobject.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qparameterizableobject_p.h"
-#include "qdeclarativegeomapparameter_p.h"
-#include <QtLocation/private/qgeomapparameter_p.h>
-#include <private/qobject_p.h>
-
-QT_BEGIN_NAMESPACE
-
-void QParameterizableObject::appendChild(QObject *v)
-{
- m_children.append(v);
-}
-
-void QParameterizableObject::clearChildren()
-{
- m_children.clear();
-}
-
-QQmlListProperty<QObject> QParameterizableObject::declarativeChildren()
-{
- return QQmlListProperty<QObject>(this, nullptr,
- &QParameterizableObject::append,
- &QParameterizableObject::count,
- &QParameterizableObject::at,
- &QParameterizableObject::clear);
-}
-
-void QParameterizableObject::append(QQmlListProperty<QObject> *p, QObject *v)
-{
- QParameterizableObject *object = static_cast<QParameterizableObject*>(p->object);
- object->appendChild(v);
-}
-
-qsizetype QParameterizableObject::count(QQmlListProperty<QObject> *p)
-{
- return static_cast<QParameterizableObject*>(p->object)->m_children.count();
-}
-
-QObject *QParameterizableObject::at(QQmlListProperty<QObject> *p, qsizetype idx)
-{
- return static_cast<QParameterizableObject*>(p->object)->m_children.at(idx);
-}
-
-void QParameterizableObject::clear(QQmlListProperty<QObject> *p)
-{
- QParameterizableObject *object = static_cast<QParameterizableObject*>(p->object);
- object->clearChildren();
-}
-
-class QParameterizableObjectData: public QAbstractDeclarativeData
-{
-public:
- QParameterizableObjectData()
- {
- init();
- }
-
- static inline void init() {
- static bool initialized = false;
- if (!initialized) {
- initialized = true;
- }
- }
-
-};
-
-Q_GLOBAL_STATIC(QParameterizableObjectData, parametrizableObjectData)
-
-QParameterizableObject::QParameterizableObject(QObject *parent)
- : QObject(parent)
-{
- QObjectPrivate::get(this)->declarativeData = parametrizableObjectData;
-}
-
-void QParameterizableObject::setParentAndNotify(QObject *parent)
-{
- QObject *oldParent = this->parent();
- QObject::setParent(parent);
- if (parent != oldParent)
- emit parentChanged();
-}
-
-QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qparameterizableobject_p.h b/src/location/declarativemaps/qparameterizableobject_p.h
deleted file mode 100644
index 431c0d31..00000000
--- a/src/location/declarativemaps/qparameterizableobject_p.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPARAMETERIZABLEOBJECT_H
-#define QPARAMETERIZABLEOBJECT_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtLocation/private/qlocationglobal_p.h>
-#include <QObject>
-#include <QQmlListProperty>
-#include <QQmlParserStatus>
-
-QT_BEGIN_NAMESPACE
-class QGeoMapParameter;
-class Q_LOCATION_PRIVATE_EXPORT QParameterizableObject : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QObject *parent READ parent NOTIFY parentChanged DESIGNABLE false FINAL)
- Q_PROPERTY(QQmlListProperty<QObject> quickChildren READ declarativeChildren DESIGNABLE false)
- Q_CLASSINFO("DefaultProperty", "quickChildren")
-
-public:
- explicit QParameterizableObject(QObject *parent = nullptr);
-
- template <typename T = QObject>
- QList<T*> quickChildren() const
- {
- QList<T*> res;
- for (auto kid : m_children) {
- auto val = qobject_cast<T*>(kid);
- if (val)
- res.push_back(val);
- }
- return res;
- }
-
- void setParentAndNotify(QObject *parent);
-
-Q_SIGNALS:
- void parentChanged();
-
-protected:
- virtual void appendChild(QObject *v);
- virtual void clearChildren();
-
- static void append(QQmlListProperty<QObject> *p, QObject *v);
- static qsizetype count(QQmlListProperty<QObject> *p);
- static QObject *at(QQmlListProperty<QObject> *p, qsizetype idx);
- static void clear(QQmlListProperty<QObject> *p);
-
- QQmlListProperty<QObject> declarativeChildren();
- QList<QObject*> m_children;
-};
-QT_END_NAMESPACE
-
-#endif // QPARAMETERIZABLEOBJECT_H
diff --git a/src/location/labs/qdeclarativenavigator.cpp b/src/location/labs/qdeclarativenavigator.cpp
deleted file mode 100644
index ffc6c454..00000000
--- a/src/location/labs/qdeclarativenavigator.cpp
+++ /dev/null
@@ -1,773 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativenavigator_p.h"
-#include "qdeclarativenavigator_p_p.h"
-#include <QtLocation/private/qdeclarativegeomap_p.h>
-#include <QtLocation/private/qdeclarativegeoserviceprovider_p.h>
-#include <QtLocation/private/qnavigationmanager_p.h>
-#include <QtLocation/private/qnavigationmanagerengine_p.h>
-#include <QtLocation/private/qgeomapparameter_p.h>
-#include <QtLocation/private/qdeclarativegeoroute_p.h>
-#include <QtLocation/private/qdeclarativegeoroutemodel_p.h>
-#include <QtLocation/private/qdeclarativegeoroutesegment_p.h>
-#include <QtLocation/qgeoserviceprovider.h>
-#include <QtPositioningQuick/private/qdeclarativepositionsource_p.h>
-#include <QtQml/qqmlinfo.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlmodule Qt.labs.location 1.0
- \title Qt Labs Location QML Types
- \ingroup qmlmodules
- \brief Provides experimental QtLocation QML types, such as \l Navigator and
- various map objects types (not to be confused with map items).
-
- To use this module, import the module with the following line:
-
- \qml
- import Qt.labs.location 1.0
- \endqml
-
- \note These types are experimental and subject to source-incompatible changes from one
- Qt minor release to the next, until they are ready to be moved to the stable QtLocation QML
- module.
-*/
-
-/*!
- \qmltype Navigator
- \instantiates QDeclarativeNavigator
- \inqmlmodule Qt.labs.location
- \ingroup qml-QtLocation5-maps
-
- \brief The Navigator type offers functionalities to perform turn-by-turn navigation.
-
- The Navigator purpose is to use a plugin's turn-by-turn navigation implementation in a QML
- application in a seamless manner.
- This object may take control of the map position, orientation, tilting and zoom, as well as changing
- the map style, elements on the map such as direction information.
- In certain cases, it may also restrict user interaction with the Map and with the items on it.
-*/
-
-/*!
- \qmlproperty Plugin Qt.labs.location::Navigator::plugin
-
- This property holds the plugin which provides the navigation functionality.
-
- This is a write-once property. Once the Navigator has a plugin associated with
- it, any attempted modifications of the plugin property will be ignored.
-
- \sa Plugin
-*/
-
-/*!
- \qmlproperty Map Qt.labs.location::Navigator::map
-
- This property holds the Map that the navigator is in charge of controlling.
-
- This is a write-once property. Once the Navigator has a Map associated with
- it, any attempted modifications of the map property will be ignored.
-
- \sa Map
-*/
-
-/*!
- \qmlproperty Route Qt.labs.location::Navigator::route
-
- This property holds the Route that the navigator is using
- to perform the navigation.
-
- \note Setting this property while a navigation session is ongoing will
- stop the navigation.
-
- \sa Route
-*/
-
-/*!
- \qmlproperty PositionSource Qt.labs.location::Navigator::positionSource
-
- This property holds the PositionSource that the navigator will receive position
- updates from to perform the navigation.
-
- This is a write-once property. Once the Navigator has a PositionSource associated with
- it, any attempted modifications of the positionSource property will be ignored.
-
- \sa PositionSource
-*/
-
-/*!
- \qmlproperty bool Qt.labs.location::Navigator::active
-
- This property tells whether the Navigator is navigating or not.
- Set this property to \c true to start the navigation.
- Set it to \c false to stop an active navigation session.
-*/
-
-/*!
- \qmlproperty bool Qt.labs.location::Navigator::navigatorReady
-
- This read-only property tells whether the navigator is ready
- to start the navigation or not.
- A Navigator becomes ready once the plugin is attached and a navigation engine has been
- instantiated, and the other required properties are set to valid values.
-*/
-
-/*!
- \qmlproperty bool Qt.labs.location::Navigator::trackPositionSource
-
- This property tells whether the Navigator should control the Map camera to
- keep track of position source updates. This property is enabled (\c true) by
- default, and setting it to \c false is useful in cases where e.g. the user
- starts gesturing over the map area.
-
- Navigator plugins can also control this property directly e.g. user map
- interaction could trigger the property change. Honoring the user-specified
- value of this property is plugin dependent.
-*/
-
-/*!
- \qmlproperty bool Qt.labs.location::Navigator::automaticReroutingEnabled
-
- This property tells whether the Navigator should automatically recalculate
- the route when the position from \l positionSource ends too far from the route.
- The operation performed in such case is equivalent to calling \l recalculateRoutes.
- The default value is \c true.
-
- \note Whether this property has any effect is plugin-dependent.
- Also, whether or not it has an effect while the navigator is active is plugin-dependent.
-*/
-
-/*!
- \qmlproperty bool Qt.labs.location::Navigator::isOnRoute
-
- While the Navigator is in active tracking mode, this property tells
- whether the position from \l positionSource is on the route or not.
-*/
-
-/*!
- \qmlmethod void Qt.labs.location::Navigator::recalculateRoutes()
-
- Calling this method forces the backend to trigger a routes recalculation.
-
- \sa automaticReroutingEnabled
-*/
-
-/*!
- \qmlproperty enumeration Qt.labs.location::Navigator::error
- \readonly
-
- This read-only property holds the latest error value of the geocoding request.
-
- \value Navigator.NoError
- No error has occurred.
- \value Navigator.NotSupportedError
- Navigation is not supported by the service provider.
- \value Navigator.ConnectionError
- An error occurred while communicating with the service provider.
- \value Navigator.LoaderError
- The geoservice provider library could not be loaded. Setting
- QT_DEBUG_PLUGINS environment variable may help diagnosing the
- problem.
- \value Navigator.UnknownParameterError
- An unknown parameter was specified.
- \value Navigator.MissingRequiredParameterError
- Required parameter was not specified.
- \value Navigator.UnknownError
- Unknown error occurred.
-*/
-
-QDeclarativeNavigatorPrivate::QDeclarativeNavigatorPrivate(QParameterizableObject *q_)
- : q(q_), m_params(new QDeclarativeNavigatorParams), m_basicDirections(static_cast<QDeclarativeNavigator *>(q_))
-{
-}
-
-QDeclarativeNavigator::QDeclarativeNavigator(QObject *parent)
- : QParameterizableObject(parent), d_ptr(new QDeclarativeNavigatorPrivate(this))
-{
-}
-
-QDeclarativeNavigator::~QDeclarativeNavigator()
-{
-}
-
-void QDeclarativeNavigator::classBegin()
-{
-}
-
-void QDeclarativeNavigator::componentComplete()
-{
- d_ptr->m_completed = true;
- // Children have been completed
- for (auto param : quickChildren<QGeoMapParameter>())
- d_ptr->m_params->m_parameters.push_back(param);
- if (d_ptr->m_plugin && d_ptr->m_plugin->isAttached())
- pluginReady();
-}
-
-QDeclarativeGeoServiceProvider *QDeclarativeNavigator::plugin() const
-{
- return d_ptr->m_plugin;
-}
-
-void QDeclarativeNavigator::setMap(QDeclarativeGeoMap *map)
-{
- if (d_ptr->m_params->m_map || !map) // set once prop
- return;
-
- d_ptr->m_params->m_map = map;
- connect(map, &QObject::destroyed, this,
- [this]() {
- this->mapChanged();
- this->updateReadyState();
- });
- emit mapChanged();
- updateReadyState();
-}
-
-QDeclarativeGeoMap *QDeclarativeNavigator::map() const
-{
- return d_ptr->m_params->m_map;
-}
-
-void QDeclarativeNavigator::setRoute(QDeclarativeGeoRoute *route)
-{
- if (d_ptr->m_params->m_route == route) // This isn't set-once
- return;
-
- const bool isReady = d_ptr->m_navigator && d_ptr->m_navigator->ready();
- const bool isActive = active();
- if (isReady && isActive)
- setActive(false); // Stop current session
-
- d_ptr->m_params->m_route = route;
- d_ptr->m_params->m_geoRoute = route ? route->route() : QGeoRoute();
- if (route) {
- connect(route, &QObject::destroyed,
- [this]() {
- // Do not stop navigation if route disappears. d_ptr->m_geoRoute will still be valid.
- // Engines can stop navigation if desired.
- this->routeChanged();
- });
- }
- emit routeChanged();
- updateReadyState();
-}
-
-QDeclarativeGeoRoute *QDeclarativeNavigator::route() const
-{
- return d_ptr->m_params->m_route;
-}
-
-void QDeclarativeNavigator::setPositionSource(QDeclarativePositionSource *positionSource)
-{
- if (d_ptr->m_params->m_positionSource || !positionSource) // set once prop
- return;
-
- d_ptr->m_params->m_positionSource = positionSource;
- QObject::connect(positionSource, &QObject::destroyed,
- [this]() {
- this->positionSourceChanged();
- this->updateReadyState();
- }
- );
- emit positionSourceChanged();
- updateReadyState();
-}
-
-QDeclarativePositionSource *QDeclarativeNavigator::positionSource() const
-{
- return d_ptr->m_params->m_positionSource;
-}
-
-// navigator automatically adjusts route when user leaves it
-bool QDeclarativeNavigator::automaticReroutingEnabled() const
-{
- if (d_ptr->m_navigator)
- return d_ptr->m_navigator->automaticReroutingEnabled();
- return d_ptr->m_params->m_autoRerouting;
-}
-
-// Whether or not it has an effect while the navigator is active should be plugin-dependent
-void QDeclarativeNavigator::setAutomaticReroutingEnabled(bool autoRerouting)
-{
- const bool autoReroutingOld = automaticReroutingEnabled();
- d_ptr->m_params->m_autoRerouting = autoRerouting;
- // Done this way, and not via signal like setTrackPositionSource because
- // plugins might not support automatic rerouting.
- if (d_ptr->m_navigator)
- d_ptr->m_navigator->setAutomaticReroutingEnabled(autoRerouting);
- if (autoRerouting != autoReroutingOld)
- emit automaticReroutingEnabledChanged();
-}
-
-
-bool QDeclarativeNavigator::navigatorReady() const
-{
- if (d_ptr->m_navigator)
- return d_ptr->m_navigator->ready();
- return d_ptr->m_ready;
-}
-
-bool QDeclarativeNavigator::trackPositionSource() const
-{
- return d_ptr->m_params->m_trackPositionSource;
-}
-
-// Navigator is in active tracking mode and the route is being followed.
-// This may turn \c false if the user leaves the route.
-bool QDeclarativeNavigator::isOnRoute() const
-{
- if (d_ptr->m_navigator)
- return d_ptr->m_navigator->isOnRoute();
- return false;
-}
-
-void QDeclarativeNavigator::setTrackPositionSource(bool trackPositionSource)
-{
- if (trackPositionSource == d_ptr->m_params->m_trackPositionSource)
- return;
-
- d_ptr->m_params->m_trackPositionSource = trackPositionSource;
-
- emit trackPositionSourceChanged(trackPositionSource);
-}
-
-QDeclarativeNavigationBasicDirections *QDeclarativeNavigator::directions() const
-{
- return &d_ptr->m_basicDirections;
-}
-
-QDeclarativeNavigator::NavigationError QDeclarativeNavigator::error() const
-{
- return d_ptr->m_error;
-}
-
-QString QDeclarativeNavigator::errorString() const
-{
- return d_ptr->m_errorString;
-}
-
-void QDeclarativeNavigator::recalculateRoutes()
-{
- if (d_ptr->m_navigator)
- d_ptr->m_navigator->recalculateRoutes();
-}
-
-/* !NOT DOCUMENTED YET!
- \qmlproperty QAbstractNavigator *Qt.labs.location::Navigator::engineHandle
-
- This property returns a handle to the navigation object created by the engine.
- This object can carry engine-specific properties, signals and methods, to expose
- engine-specific features and data.
-
- \warning Using this property leads to writing code that's likely to work
- with only a single plugin.
-*/
-QAbstractNavigator *QDeclarativeNavigator::abstractNavigator() const
-{
- return d_ptr->m_navigator.get();
-}
-
-bool QDeclarativeNavigator::active() const
-{
- return d_ptr->m_active;
-}
-
-void QDeclarativeNavigator::setPlugin(QDeclarativeGeoServiceProvider *plugin)
-{
- if (d_ptr->m_plugin)
- return; // set once property.
-
- d_ptr->m_plugin = plugin;
- emit pluginChanged();
-
- if (d_ptr->m_plugin->isAttached()) {
- pluginReady();
- } else {
- connect(d_ptr->m_plugin, &QDeclarativeGeoServiceProvider::attached,
- this, &QDeclarativeNavigator::pluginReady);
- }
-}
-
-void QDeclarativeNavigator::setActive(bool active)
-{
- if (d_ptr->m_active == active)
- return;
-
- d_ptr->m_active = active;
- if (!d_ptr->m_plugin)
- return;
-
- if (active)
- start();
- else
- stop();
-}
-
-void QDeclarativeNavigator::start()
-{
- if (!d_ptr->m_ready) {
- qmlWarning(this) << QStringLiteral("Navigation manager not ready.");
- return;
- }
-
- if (!d_ptr->m_navigator->active())
- d_ptr->m_active = d_ptr->m_navigator->start();
-}
-
-void QDeclarativeNavigator::stop()
-{
- if (!ensureEngine()) { // If somebody re-set route to null or something, this may become !d_ptr->m_ready
- qmlWarning(this) << QStringLiteral("Navigation manager not ready.");
- return;
- }
-
- if (d_ptr->m_navigator->active())
- d_ptr->m_active = d_ptr->m_navigator->stop();
-
- // Cached data are cleared in response to signals emitted by m_navigator upon stop().
- // For example, m_navigator emits currentRouteChanged with an empty route,
- // and QDeclarativeNavigationBasicDirections reacts by clearing the declarative route.
-}
-
-void QDeclarativeNavigator::pluginReady()
-{
- if (!d_ptr->m_completed)
- return;
-
- ensureEngine();
- updateReadyState();
- if (d_ptr->m_active)
- start();
-}
-
-bool QDeclarativeNavigator::ensureEngine()
-{
- if (d_ptr->m_navigator)
- return true;
- if (!d_ptr->m_completed || !d_ptr->m_plugin->isAttached())
- return false;
-
- QGeoServiceProvider *serviceProvider = d_ptr->m_plugin->sharedGeoServiceProvider();
- // if m_plugin->isAttached(), serviceProvider cannot be null
- QNavigationManager *manager = serviceProvider->navigationManager();
-
- if (serviceProvider->navigationError() != QGeoServiceProvider::NoError) {
- QDeclarativeNavigator::NavigationError newError = UnknownError;
- switch (serviceProvider->navigationError()) {
- case QGeoServiceProvider::NotSupportedError:
- newError = NotSupportedError; break;
- case QGeoServiceProvider::UnknownParameterError:
- newError = UnknownParameterError; break;
- case QGeoServiceProvider::MissingRequiredParameterError:
- newError = MissingRequiredParameterError; break;
- case QGeoServiceProvider::ConnectionError:
- newError = ConnectionError; break;
- case QGeoServiceProvider::LoaderError:
- newError = LoaderError; break;
- default:
- break;
- }
-
- setError(newError, serviceProvider->navigationErrorString());
- return false;
- }
-
- if (!manager) {
- setError(NotSupportedError, tr("Plugin does not support navigation."));
- return false;
- }
-
- d_ptr->m_navigator.reset(manager->createNavigator(d_ptr->m_params));
- if (!d_ptr->m_navigator) {
- setError(UnknownError, tr("Failed to create a navigator object."));
- return false;
- }
-
- d_ptr->m_navigator->setLocale(manager->locale());
- d_ptr->m_navigator->setMeasurementSystem(manager->measurementSystem());
-
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::activeChanged, this, [this](bool active){
- d_ptr->m_active = active;
- emit activeChanged(active);
- });
- connect(this, &QDeclarativeNavigator::trackPositionSourceChanged, d_ptr->m_navigator.get(), &QAbstractNavigator::setTrackPosition);
-
- // read-only progress info updates
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::waypointReached,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::waypointReached);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::destinationReached,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::destinationReached);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::currentRouteChanged,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::onCurrentRouteChanged);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::currentRouteLegChanged,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::onCurrentRouteLegChanged);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::currentSegmentChanged,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::currentSegmentChanged);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::nextManeuverIconChanged,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::nextManeuverIconChanged);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::progressInformationChanged,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::progressInformationChanged);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::isOnRouteChanged,
- this, &QDeclarativeNavigator::isOnRouteChanged);
- connect(d_ptr->m_navigator.get(), &QAbstractNavigator::alternativeRoutesChanged,
- &d_ptr->m_basicDirections, &QDeclarativeNavigationBasicDirections::onAlternativeRoutesChanged);
-
- emit navigatorReadyChanged(true);
- return true;
-}
-
-void QDeclarativeNavigator::updateReadyState() {
- const bool oldReady = d_ptr->m_ready;
- if (!d_ptr->m_navigator)
- d_ptr->m_ready = false;
- else
- d_ptr->m_ready = d_ptr->m_navigator->ready();
-
- if (oldReady != d_ptr->m_ready)
- emit navigatorReadyChanged(d_ptr->m_ready);
-}
-
-void QDeclarativeNavigator::setError(QDeclarativeNavigator::NavigationError error, const QString &errorString)
-{
- d_ptr->m_error = error;
- d_ptr->m_errorString = errorString;
- emit errorChanged();
-}
-
-QDeclarativeNavigationBasicDirections::QDeclarativeNavigationBasicDirections(QDeclarativeNavigator *parent)
-: QObject(parent), m_navigator(parent), m_routes(QByteArrayLiteral("routeData"), this)
-{
- if (m_navigator)
- m_navigatorPrivate = m_navigator->d_ptr.get();
-}
-
-/*!
- \qmlpropertygroup Qt.labs.location::Navigator::directions
- \readonly
- \qmlproperty Variant Qt.labs.location::Navigator::directions.nextManeuverIcon
- \qmlproperty real Qt.labs.location::Navigator::directions.distanceToNextManeuver
- \qmlproperty real Qt.labs.location::Navigator::directions.remainingTravelDistance
- \qmlproperty real Qt.labs.location::Navigator::directions.remainingTravelDistanceToNextWaypoint
- \qmlproperty real Qt.labs.location::Navigator::directions.traveledDistance
- \qmlproperty int Qt.labs.location::Navigator::directions.timeToNextManeuver
- \qmlproperty int Qt.labs.location::Navigator::directions.remainingTravelTime
- \qmlproperty int Qt.labs.location::Navigator::directions.remainingTravelTimeToNextWaypoint
- \qmlproperty int Qt.labs.location::Navigator::directions.traveledTime
- \qmlproperty Route Qt.labs.location::Navigator::directions.currentRoute
- \qmlproperty RouteLeg Qt.labs.location::Navigator::directions.currentRouteLeg
- \qmlproperty int Qt.labs.location::Navigator::directions.currentSegment
- \qmlproperty model Qt.labs.location::Navigator::directions.alternativeRoutes
-
- These read-only properties are part of the \e directions property group.
- This property group holds the navigation progress information that can be
- used to access the route data and to extract directions.
-
- \note Some backends might not provide a full set of navigation progress
- information.
-
- \list
- \li The \c nextManeuverIcon property holds the next turn icon.
- \li The \c distanceToNextManeuver property holds the distance to the
- next maneuver, in meters.
- \li The \c remainingTravelDistance property holds the remaining travel
- distance, in meters.
- \li The \c remainingTravelDistanceToNextWaypoint property holds the
- remaining travel distance to the next waypoint, in meters.
- \li The \c traveledDistance property holds the traveled distance, in
- meters.
- \li The \c timeToNextManeuver property holds the time to the next
- maneuver, in milliseconds.
- \li The \c remainingTravelTime property holds the remaining travel
- time, in milliseconds.
- \li The \c remainingTravelTimeToNextWaypoint property holds the
- remaining travel time to the next waypoint, in milliseconds.
- \li The \c traveledTime property holds the traveled time, in
- milliseconds.
- \li The \c currentRoute property holds the current route the navigator
- is following. This can be the same as \l route, or can be
- different, if the navigator cannot follow the user-specified route.
- For example, if the position coming from \l positionSource is
- considerably off route, the navigation engine may recalculate and
- start to follow a new route.
- \li The \c currentRouteLeg property holds the current route leg the
- navigator is following. This is always a part of \c currentRoute,
- so the \l {RouteLeg::}{overallRoute} property of \c currentRouteLeg
- holds the same route as \c currentRoute.
- \li The \c currentSegment property holds the index of the current
- RouteSegment in the \c currentRoute.
- \li The \c alternativeRoutes property holds the list of alternative routes provided by
- the engine. If no alternative routes are present, the model will be empty.
- \endlist
-
- \sa directions.waypointReached(), directions.destinationReached(), Route, RouteLeg, RouteSegment, Waypoint
-*/
-
-/*!
- \qmlsignal Qt.labs.location::Navigator::directions.waypointReached(Waypoint waypoint)
-
- This signal is emitted when a \a waypoint has been reached.
-
- \sa directions, directions.destinationReached()
-*/
-
-/*!
- \qmlsignal Qt.labs.location::Navigator::directions.destinationReached()
-
- This signal is emitted when the last waypoint of the route, the
- destination, has been reached.
-
- \sa directions, directions.waypointReached()
-*/
-QVariant QDeclarativeNavigationBasicDirections::nextManeuverIcon() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->nextManeuverIcon();
- return QVariant();
-}
-
-qreal QDeclarativeNavigationBasicDirections::distanceToNextManeuver() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->distanceToNextManeuver();
- return qQNaN();
-}
-
-qreal QDeclarativeNavigationBasicDirections::remainingTravelDistance() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->remainingTravelDistance();
- return qQNaN();
-}
-
-qreal QDeclarativeNavigationBasicDirections::remainingTravelDistanceToNextWaypoint() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->remainingTravelDistanceToNextWaypoint();
- return qQNaN();
-}
-
-qreal QDeclarativeNavigationBasicDirections::traveledDistance() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->traveledDistance();
- return 0;
-}
-
-int QDeclarativeNavigationBasicDirections::timeToNextManeuver() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->timeToNextManeuver();
- return -1;
-}
-
-int QDeclarativeNavigationBasicDirections::remainingTravelTime() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->remainingTravelTime();
- return -1;
-}
-
-int QDeclarativeNavigationBasicDirections::remainingTravelTimeToNextWaypoint() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->remainingTravelTimeToNextWaypoint();
- return -1;
-}
-
-int QDeclarativeNavigationBasicDirections::traveledTime() const
-{
- if (m_navigatorPrivate->m_navigator)
- return m_navigatorPrivate->m_navigator->traveledTime();
- return 0;
-}
-
-QDeclarativeGeoRoute *QDeclarativeNavigationBasicDirections::currentRoute() const
-{
- if (!m_navigatorPrivate->m_ready
- || !m_navigatorPrivate->m_navigator
- || !m_navigatorPrivate->m_navigator->active())
- return m_navigatorPrivate->m_params->m_route.data(); // the user-specified route, if any
- return m_currentRoute;
-}
-
-QDeclarativeGeoRouteLeg *QDeclarativeNavigationBasicDirections::currentRouteLeg() const
-{
- if (!m_navigatorPrivate->m_ready
- || !m_navigatorPrivate->m_navigator
- || !m_navigatorPrivate->m_navigator->active())
- return nullptr;
- return m_currentRouteLeg;
-}
-
-int QDeclarativeNavigationBasicDirections::currentSegment() const
-{
- if (!m_navigatorPrivate->m_ready
- || !m_navigatorPrivate->m_navigator
- || !m_navigatorPrivate->m_navigator->active())
- return 0;
- return m_navigatorPrivate->m_navigator->currentSegment();
-}
-
-QAbstractItemModel *QDeclarativeNavigationBasicDirections::alternativeRoutes()
-{
- return &m_routes;
-}
-
-void QDeclarativeNavigationBasicDirections::onCurrentRouteChanged()
-{
- if (m_currentRoute)
- m_currentRoute->deleteLater();
- m_currentRoute = new QDeclarativeGeoRoute(m_navigatorPrivate->m_navigator->currentRoute(), this);
- emit currentRouteChanged();
-}
-
-void QDeclarativeNavigationBasicDirections::onCurrentRouteLegChanged()
-{
- if (m_currentRouteLeg)
- m_currentRouteLeg->deleteLater();
- m_currentRouteLeg = new QDeclarativeGeoRouteLeg(m_navigatorPrivate->m_navigator->currentRouteLeg(), this);
- emit currentRouteLegChanged();
-}
-
-void QDeclarativeNavigationBasicDirections::onAlternativeRoutesChanged()
-{
- const QList<QGeoRoute> &routes = m_navigatorPrivate->m_navigator->alternativeRoutes();
- QList<QDeclarativeGeoRoute *> declarativeRoutes;
- for (const auto &route : routes) {
- QDeclarativeGeoRoute *declroute = new QDeclarativeGeoRoute(route, &m_routes);
- QQmlEngine::setContextForObject(declroute, QQmlEngine::contextForObject(this));
- declarativeRoutes.append(declroute);
- }
- m_routes.updateData(declarativeRoutes);
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/location/labs/qdeclarativenavigator_p.h b/src/location/labs/qdeclarativenavigator_p.h
deleted file mode 100644
index 17282c74..00000000
--- a/src/location/labs/qdeclarativenavigator_p.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVENAVIGATOR_P_H
-#define QDECLARATIVENAVIGATOR_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtLocation/private/qlocationglobal_p.h>
-#include <QtQml/qqml.h>
-#include <QSharedPointer>
-#include <QtLocation/private/qparameterizableobject_p.h>
-#include <QtLocation/qgeoserviceprovider.h>
-
-Q_MOC_INCLUDE(<QtLocation/private/qdeclarativenavigator_p_p.h>)
-Q_MOC_INCLUDE(<QtLocation/private/qdeclarativegeomap_p.h>)
-Q_MOC_INCLUDE(<QtLocation/private/qdeclarativegeoroute_p.h>)
-Q_MOC_INCLUDE(<QtLocation/private/qdeclarativegeoserviceprovider_p.h>)
-Q_MOC_INCLUDE(<QtLocation/private/qnavigationmanagerengine_p.h>)
-Q_MOC_INCLUDE(<QtPositioningQuick/private/qdeclarativepositionsource_p.h>)
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeGeoServiceProvider;
-class QDeclarativeGeoMap;
-class QNavigationManager;
-class QDeclarativeGeoRoute;
-class QDeclarativeGeoRouteLeg;
-class QDeclarativePositionSource;
-class QDeclarativeGeoWaypoint;
-class QGeoRoute;
-class QGeoRouteLeg;
-class QGeoRouteSegment;
-class QDeclarativeNavigatorPrivate;
-class QDeclarativeGeoRouteSegment;
-class QDeclarativeNavigationBasicDirections;
-class QAbstractNavigator;
-
-class Q_LOCATION_PRIVATE_EXPORT QDeclarativeNavigator : public QParameterizableObject, public QQmlParserStatus
-{
- Q_OBJECT
- Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged)
- Q_PROPERTY(QDeclarativeGeoMap *map READ map WRITE setMap NOTIFY mapChanged)
- Q_PROPERTY(QDeclarativeGeoRoute *route READ route WRITE setRoute NOTIFY routeChanged)
- Q_PROPERTY(QDeclarativePositionSource *positionSource READ positionSource WRITE setPositionSource NOTIFY positionSourceChanged)
- Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
- Q_PROPERTY(bool navigatorReady READ navigatorReady NOTIFY navigatorReadyChanged)
- Q_PROPERTY(bool trackPositionSource READ trackPositionSource WRITE setTrackPositionSource NOTIFY trackPositionSourceChanged)
- Q_PROPERTY(bool automaticReroutingEnabled READ automaticReroutingEnabled WRITE setAutomaticReroutingEnabled NOTIFY automaticReroutingEnabledChanged)
- Q_PROPERTY(bool isOnRoute READ isOnRoute NOTIFY isOnRouteChanged)
- Q_PROPERTY(QDeclarativeNavigationBasicDirections *directions READ directions CONSTANT)
- Q_PROPERTY(NavigationError error READ error NOTIFY errorChanged)
- Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
- Q_PROPERTY(QAbstractNavigator *engineHandle READ abstractNavigator CONSTANT)
-
- Q_INTERFACES(QQmlParserStatus)
-
-public:
- enum NavigationError {
- //QGeoServiceProvider related errors start here
- NoError = QGeoServiceProvider::NoError,
- NotSupportedError = QGeoServiceProvider::NotSupportedError, //TODO Qt6 consider merge with NotSupportedError
- ConnectionError = QGeoServiceProvider::ConnectionError, //TODO Qt6 merge with Map's ConnectionError
- LoaderError = QGeoServiceProvider::LoaderError,
- UnknownParameterError = QGeoServiceProvider::UnknownParameterError, //TODO Qt6 consider rename UnsupportedOperationError
- MissingRequiredParameterError = QGeoServiceProvider::MissingRequiredParameterError,
- //we leave gap for future QGeoCodeReply errors
-
- // Navigation-specific error should start at 100
- UnknownError = 100
- };
-
- explicit QDeclarativeNavigator(QObject *parent = nullptr);
- ~QDeclarativeNavigator();
-
- // QQmlParserStatus interface
- void classBegin() override;
- void componentComplete() override;
-
- // QDeclarativeNavigator
- void start();
- void stop();
-
- void setActive(bool active);
- bool active() const;
-
- void setPlugin(QDeclarativeGeoServiceProvider * plugin);
- QDeclarativeGeoServiceProvider *plugin() const;
-
- void setMap(QDeclarativeGeoMap *map);
- QDeclarativeGeoMap * map() const;
-
- void setRoute(QDeclarativeGeoRoute *route);
- QDeclarativeGeoRoute *route() const;
-
- void setPositionSource(QDeclarativePositionSource *positionSource);
- QDeclarativePositionSource *positionSource() const;
-
- // To enable/disable automatic route recalculation in the engines
- bool automaticReroutingEnabled() const;
- void setAutomaticReroutingEnabled(bool autoRerouting);
-
- bool navigatorReady() const;
-
- void setTrackPositionSource(bool trackPositionSource);
- bool trackPositionSource() const;
-
- // To discover/notify when the tracked position goes off the active navigation route
- bool isOnRoute() const;
-
- QDeclarativeNavigationBasicDirections *directions() const;
- QAbstractNavigator *abstractNavigator() const;
-
- NavigationError error() const;
- QString errorString() const;
-
- Q_INVOKABLE void recalculateRoutes();
-
-signals:
- void navigatorReadyChanged(bool ready);
- void trackPositionSourceChanged(bool trackPositionSource);
- void activeChanged(bool active);
-
- void pluginChanged();
- void mapChanged();
- void routeChanged();
- void positionSourceChanged();
- void errorChanged();
- void automaticReroutingEnabledChanged();
- void isOnRouteChanged();
-
-protected:
- void pluginReady();
- bool ensureEngine();
- void updateReadyState();
- void setError(NavigationError error, const QString &errorString);
-
-private:
- std::unique_ptr<QDeclarativeNavigatorPrivate> d_ptr;
-
- friend class QDeclarativeNavigatorPrivate;
- friend class QDeclarativeNavigationBasicDirections;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeNavigator)
-
-
-#endif // QDECLARATIVENAVIGATOR_P_H
diff --git a/src/location/labs/qdeclarativenavigator_p_p.h b/src/location/labs/qdeclarativenavigator_p_p.h
deleted file mode 100644
index 354b1c97..00000000
--- a/src/location/labs/qdeclarativenavigator_p_p.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVENAVIGATOR_P_P_H
-#define QDECLARATIVENAVIGATOR_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qlist.h>
-#include <QtLocation/private/qlocationglobal_p.h>
-#include <QtCore/qpointer.h>
-#include <QtLocation/qgeoroute.h>
-#include <QtLocation/private/qdeclarativenavigator_p.h>
-#include <QAbstractListModel>
-#include <QtLocation/private/qdeclarativegeoroute_p.h>
-#include <QtLocation/private/qdeclarativegeoroutemodel_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeGeoServiceProvider;
-class QDeclarativeGeoMap;
-class QNavigationManager;
-class QDeclarativeGeoRoute;
-class QDeclarativeGeoRouteLeg;
-class QDeclarativePositionSource;
-class QGeoMapParameter;
-class QDeclarativeGeoRouteSegment;
-class QParameterizableObject;
-class QAbstractNavigator;
-
-template<typename T, int Role>
-class ReadOnlyListModel : public QAbstractListModel
-{
-public:
- explicit ReadOnlyListModel(const QByteArray &dataRoleName, QObject *parent = nullptr)
- : QAbstractListModel(parent)
- {
- m_roleNames.insert(Role, dataRoleName);
- }
-
- int rowCount(const QModelIndex &) const override
- {
- return m_data.size();
- }
-
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
- {
- const int row = index.row();
- if (!index.isValid() || row < 0 || row >= m_data.size() || role != Role)
- return QVariant();
-
- return QVariant::fromValue(m_data.at(row));
- }
-
- QHash<int, QByteArray> roleNames() const override
- {
- return m_roleNames;
- }
-
- void updateData(const QList<T*> &data)
- {
- beginResetModel();
- qDeleteAll(m_data);
- m_data = data;
- endResetModel();
- }
-
-protected:
- QHash<int, QByteArray> m_roleNames;
- QList<T*> m_data;
-};
-
-class Q_LOCATION_PRIVATE_EXPORT QDeclarativeNavigationBasicDirections : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(QVariant nextManeuverIcon READ nextManeuverIcon NOTIFY nextManeuverIconChanged)
- Q_PROPERTY(qreal distanceToNextManeuver READ distanceToNextManeuver NOTIFY progressInformationChanged)
- Q_PROPERTY(qreal remainingTravelDistance READ remainingTravelDistance NOTIFY progressInformationChanged)
- Q_PROPERTY(qreal remainingTravelDistanceToNextWaypoint READ remainingTravelDistanceToNextWaypoint NOTIFY progressInformationChanged)
- Q_PROPERTY(qreal traveledDistance READ traveledDistance NOTIFY progressInformationChanged)
- Q_PROPERTY(int timeToNextManeuver READ timeToNextManeuver NOTIFY progressInformationChanged)
- Q_PROPERTY(int remainingTravelTime READ remainingTravelTime NOTIFY progressInformationChanged)
- Q_PROPERTY(int remainingTravelTimeToNextWaypoint READ remainingTravelTimeToNextWaypoint NOTIFY progressInformationChanged)
- Q_PROPERTY(int traveledTime READ traveledTime NOTIFY progressInformationChanged)
- Q_PROPERTY(QDeclarativeGeoRoute *currentRoute READ currentRoute NOTIFY currentRouteChanged)
- Q_PROPERTY(QDeclarativeGeoRouteLeg *currentRouteLeg READ currentRouteLeg NOTIFY currentRouteChanged)
- Q_PROPERTY(int currentSegment READ currentSegment NOTIFY currentSegmentChanged)
- Q_PROPERTY(QAbstractItemModel *alternativeRoutes READ alternativeRoutes CONSTANT)
-
-public:
- explicit QDeclarativeNavigationBasicDirections(QDeclarativeNavigator *parent);
-
- QVariant nextManeuverIcon() const;
- qreal distanceToNextManeuver() const;
- qreal remainingTravelDistance() const;
- qreal remainingTravelDistanceToNextWaypoint() const;
- qreal traveledDistance() const;
- int timeToNextManeuver() const;
- int remainingTravelTime() const;
- int remainingTravelTimeToNextWaypoint() const;
- int traveledTime() const;
-
- QDeclarativeGeoRoute *currentRoute() const;
- QDeclarativeGeoRouteLeg *currentRouteLeg() const;
- int currentSegment() const;
- QAbstractItemModel *alternativeRoutes();
-
-Q_SIGNALS:
- void progressInformationChanged();
- void nextManeuverIconChanged();
- void currentRouteChanged();
- void currentRouteLegChanged();
- void currentSegmentChanged();
- void waypointReached(const QDeclarativeGeoWaypoint *pos);
- void destinationReached();
-
-protected slots:
- void onCurrentRouteChanged();
- void onCurrentRouteLegChanged();
- void onAlternativeRoutesChanged();
-
-protected:
- QDeclarativeNavigator *m_navigator;
- QDeclarativeNavigatorPrivate *m_navigatorPrivate;
- QPointer<QDeclarativeGeoRoute> m_currentRoute;
- QPointer<QDeclarativeGeoRouteLeg> m_currentRouteLeg;
- ReadOnlyListModel<QDeclarativeGeoRoute, QDeclarativeGeoRouteModel::RouteRole> m_routes;
-
- friend class QDeclarativeNavigator;
-};
-
-class Q_LOCATION_PRIVATE_EXPORT QDeclarativeNavigatorParams
-{
-public:
- QPointer<QDeclarativeGeoMap> m_map;
- QPointer<QDeclarativeGeoRoute> m_route;
- QGeoRoute m_geoRoute;
- QPointer<QDeclarativePositionSource> m_positionSource;
- QList<QPointer<QGeoMapParameter>> m_parameters;
- bool m_trackPositionSource = true;
- bool m_autoRerouting = true;
-};
-
-class QDeclarativeNavigatorPrivate
-{
-public:
- QDeclarativeNavigatorPrivate(QParameterizableObject *q_);
-
- QParameterizableObject *q = nullptr;
- QSharedPointer<QDeclarativeNavigatorParams> m_params;
- std::unique_ptr<QAbstractNavigator> m_navigator;
- QDeclarativeGeoServiceProvider *m_plugin = nullptr;
- QDeclarativeNavigationBasicDirections m_basicDirections;
-
- bool m_active = false;
- bool m_completed = false;
- bool m_ready = false;
- QDeclarativeNavigator::NavigationError m_error = QDeclarativeNavigator::NoError;
- QString m_errorString;
-};
-
-QT_END_NAMESPACE
-
-#endif // QDECLARATIVENAVIGATOR_P_P_H
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index fbe25ce3..ea838deb 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -45,13 +45,11 @@
#include "qgeomappingmanager_p.h"
#include "qgeoroutingmanager.h"
#include "qplacemanager.h"
-#include "qnavigationmanager_p.h"
#include "qgeocodingmanagerengine.h"
#include "qgeomappingmanagerengine_p.h"
#include "qgeoroutingmanagerengine.h"
#include "qplacemanagerengine.h"
#include "qplacemanagerengine_p.h"
-#include "qnavigationmanagerengine_p.h"
#include <QList>
#include <QString>
@@ -363,10 +361,6 @@ template <> QPlaceManagerEngine *createEngine<QPlaceManagerEngine>(QGeoServicePr
{
return d_ptr->factory->createPlaceManagerEngine(d_ptr->cleanedParameterMap, &(d_ptr->placeError), &(d_ptr->placeErrorString));
}
-template <> QNavigationManagerEngine *createEngine<QNavigationManagerEngine>(QGeoServiceProviderPrivate *d_ptr)
-{
- return d_ptr->factory->createNavigationManagerEngine(d_ptr->cleanedParameterMap, &(d_ptr->navigationError), &(d_ptr->navigationErrorString));
-}
/* Template for generating the code for each of the geocodingManager(),
* mappingManager() etc methods */
@@ -546,22 +540,6 @@ QPlaceManager *QGeoServiceProvider::placeManager() const
}
/*!
- Returns a new QNavigationManager made available by the service provider.
-
- After this function has been called, error() and errorString() will
- report any errors which occurred during the construction of the QNavigationManagerEngine.
-*/
-QNavigationManager *QGeoServiceProvider::navigationManager() const
-{
- QNavigationManager * mgr = d_ptr->manager<QNavigationManager, QNavigationManagerEngine>(
- &(d_ptr->navigationError), &(d_ptr->navigationErrorString),
- &(d_ptr->navigationManager));
- if (!mgr)
- qDebug() << d_ptr->error << ", " << d_ptr->errorString;
- return mgr;
-}
-
-/*!
Returns an error code describing the error which occurred during the
last operation that was performed by this class.
*/
@@ -747,8 +725,6 @@ void QGeoServiceProvider::setLocale(const QLocale &locale)
d_ptr->mappingManager->setLocale(locale);
if (d_ptr->placeManager)
d_ptr->placeManager->setLocale(locale);
- if (d_ptr->navigationManager)
- d_ptr->navigationManager->setLocale(locale);
}
/*******************************************************************************
@@ -777,7 +753,6 @@ QGeoServiceProviderPrivate::~QGeoServiceProviderPrivate()
delete routingManager;
delete mappingManager;
delete placeManager;
- delete navigationManager;
}
void QGeoServiceProviderPrivate::unload()
@@ -794,9 +769,6 @@ void QGeoServiceProviderPrivate::unload()
delete placeManager;
placeManager = nullptr;
- delete navigationManager;
- navigationManager = nullptr;
-
factory = nullptr;
error = QGeoServiceProvider::NoError;
errorString = QLatin1String("");
diff --git a/src/location/maps/qgeoserviceprovider.h b/src/location/maps/qgeoserviceprovider.h
index 0cde3137..32679f9e 100644
--- a/src/location/maps/qgeoserviceprovider.h
+++ b/src/location/maps/qgeoserviceprovider.h
@@ -52,12 +52,10 @@ class QGeoCodingManager;
class QGeoMappingManager;
class QGeoRoutingManager;
class QPlaceManager;
-class QNavigationManager;
class QGeoCodingManagerEngine;
class QGeoMappingManagerEngine;
class QGeoRoutingManagerEngine;
class QPlaceManagerEngine;
-class QNavigationManagerEngine;
class QGeoServiceProviderPrivate;
class QQmlEngine;
@@ -158,7 +156,6 @@ public:
QGeoMappingManager *mappingManager() const;
QGeoRoutingManager *routingManager() const;
QPlaceManager *placeManager() const;
- QNavigationManager *navigationManager() const;
Error error() const;
QString errorString() const;
diff --git a/src/location/maps/qgeoserviceprovider_p.h b/src/location/maps/qgeoserviceprovider_p.h
index cd7dbf73..03c0a798 100644
--- a/src/location/maps/qgeoserviceprovider_p.h
+++ b/src/location/maps/qgeoserviceprovider_p.h
@@ -98,7 +98,6 @@ public:
QGeoRoutingManager *routingManager;
QGeoMappingManager *mappingManager;
QPlaceManager *placeManager;
- QNavigationManager *navigationManager = nullptr;
QQmlEngine *qmlEngine = nullptr;
QGeoServiceProvider::Error geocodeError;
diff --git a/src/location/maps/qgeoserviceproviderfactory.cpp b/src/location/maps/qgeoserviceproviderfactory.cpp
index fdd27464..62007bf1 100644
--- a/src/location/maps/qgeoserviceproviderfactory.cpp
+++ b/src/location/maps/qgeoserviceproviderfactory.cpp
@@ -168,31 +168,6 @@ QGeoServiceProviderFactory::createPlaceManagerEngine(const QVariantMap &paramete
}
/*!
- Returns a new QNavigationManagerEngine instance, initialized with \a
- parameters, which implements navigation functionality.
-
- If \a error is not \nullptr, it should be set to QGeoServiceProvider::NoError on
- success or an appropriate QGeoServiceProvider::Error on failure.
-
- If \a errorString is not \nullptr, it should be set to a string describing any
- error which occurred.
-
- The default implementation returns \nullptr, which causes a
- QGeoServiceProvider::NotSupportedError in QGeoServiceProvider.
-*/
-QNavigationManagerEngine *
-QGeoServiceProviderFactory::createNavigationManagerEngine(const QVariantMap &parameters,
- QGeoServiceProvider::Error *error,
- QString *errorString) const
-{
- Q_UNUSED(parameters);
- Q_UNUSED(error);
- Q_UNUSED(errorString);
-
- return nullptr;
-}
-
-/*!
Notify the plugin when the qml engine is ready. In this moment the plugins can use it
to register Image Providers.
diff --git a/src/location/maps/qgeoserviceproviderfactory.h b/src/location/maps/qgeoserviceproviderfactory.h
index f804cbe6..9b71f03c 100644
--- a/src/location/maps/qgeoserviceproviderfactory.h
+++ b/src/location/maps/qgeoserviceproviderfactory.h
@@ -67,9 +67,6 @@ public:
QGeoServiceProvider::Error *error,
QString *errorString) const;
- virtual QNavigationManagerEngine *createNavigationManagerEngine(const QVariantMap &parameters,
- QGeoServiceProvider::Error *error,
- QString *errorString) const;
virtual void setQmlEngine(QQmlEngine * engine);
};
diff --git a/src/location/maps/qnavigationmanager.cpp b/src/location/maps/qnavigationmanager.cpp
deleted file mode 100644
index f5f4dc57..00000000
--- a/src/location/maps/qnavigationmanager.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qnavigationmanager_p.h"
-#include "qnavigationmanagerengine_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QNavigationManagerPrivate
-{
-public:
- QNavigationManagerPrivate();
- ~QNavigationManagerPrivate();
-
- QNavigationManagerEngine *engine = nullptr;
-
-private:
- Q_DISABLE_COPY(QNavigationManagerPrivate)
-};
-
-QNavigationManagerPrivate::QNavigationManagerPrivate() = default;
-QNavigationManagerPrivate::~QNavigationManagerPrivate()
-{
- delete engine;
-}
-
-QNavigationManager::~QNavigationManager()
-{
- delete d_ptr;
-}
-
-QString QNavigationManager::managerName() const
-{
- return d_ptr->engine->managerName();
-}
-
-int QNavigationManager::managerVersion() const
-{
- return d_ptr->engine->managerVersion();
-}
-
-QNavigationManagerEngine *QNavigationManager::engine()
-{
- return d_ptr->engine;
-}
-
-bool QNavigationManager::isInitialized() const
-{
- return d_ptr->engine->isInitialized();
-}
-
-void QNavigationManager::setLocale(const QLocale &locale)
-{
- d_ptr->engine->setLocale(locale);
-}
-
-QLocale QNavigationManager::locale() const
-{
- return d_ptr->engine->locale();
-}
-
-void QNavigationManager::setMeasurementSystem(QLocale::MeasurementSystem system)
-{
- d_ptr->engine->setMeasurementSystem(system);
-}
-
-QLocale::MeasurementSystem QNavigationManager::measurementSystem() const
-{
- return d_ptr->engine->measurementSystem();
-}
-
-QAbstractNavigator *QNavigationManager::createNavigator(const QSharedPointer<QDeclarativeNavigatorParams> &navigator)
-{
- return d_ptr->engine->createNavigator(navigator);
-}
-
-QNavigationManager::QNavigationManager(QNavigationManagerEngine *engine, QObject *parent) : QObject(parent),
- d_ptr(new QNavigationManagerPrivate)
-{
- d_ptr->engine = engine;
- if (!d_ptr->engine) {
- qFatal("The navigation manager engine that was set for this mapping manager was NULL.");
- }
-
- connect(d_ptr->engine, &QNavigationManagerEngine::initialized,
- this, &QNavigationManager::initialized, Qt::QueuedConnection);
-}
-
-QT_END_NAMESPACE
diff --git a/src/location/maps/qnavigationmanager_p.h b/src/location/maps/qnavigationmanager_p.h
deleted file mode 100644
index 4d137ca6..00000000
--- a/src/location/maps/qnavigationmanager_p.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QNAVIGATIONMANAGER_P_H
-#define QNAVIGATIONMANAGER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QObject>
-#include <QLocale>
-#include <QtLocation/private/qlocationglobal_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QNavigationManagerEngine;
-class QNavigationManagerPrivate;
-class QDeclarativeNavigatorParams;
-class QDeclarativeGeoWaypoint;
-class QGeoRoute;
-class QGeoRouteSegment;
-class QAbstractNavigator;
-class Q_LOCATION_PRIVATE_EXPORT QNavigationManager : public QObject
-{
- Q_OBJECT
-
-public:
- ~QNavigationManager();
-
- QString managerName() const;
- int managerVersion() const;
- QNavigationManagerEngine *engine();
- bool isInitialized() const;
-
- void setLocale(const QLocale &locale);
- QLocale locale() const;
- void setMeasurementSystem(QLocale::MeasurementSystem system);
- QLocale::MeasurementSystem measurementSystem() const;
-
- QAbstractNavigator *createNavigator(const QSharedPointer<QDeclarativeNavigatorParams> &navigator);
-
-Q_SIGNALS:
- void initialized();
-
-
-protected:
- QNavigationManager(QNavigationManagerEngine *engine, QObject *parent = nullptr);
-
-private:
- QNavigationManagerPrivate *d_ptr;
- Q_DISABLE_COPY(QNavigationManager)
-
- friend class QGeoServiceProvider;
- friend class QGeoServiceProviderPrivate;
-};
-
-
-QT_END_NAMESPACE
-
-#endif // QNAVIGATIONMANAGER_P_H
diff --git a/src/location/maps/qnavigationmanagerengine.cpp b/src/location/maps/qnavigationmanagerengine.cpp
deleted file mode 100644
index eb0fddd5..00000000
--- a/src/location/maps/qnavigationmanagerengine.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeoroute.h"
-#include "qnavigationmanagerengine_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QNavigationManagerEnginePrivate
-{
-public:
- QString managerName;
- int managerVersion;
- QLocale locale;
- QLocale::MeasurementSystem measurementSystem;
- bool initialized = false;
-};
-
-class QAbstractNavigatorPrivate
-{
-public:
- QLocale locale;
- QLocale::MeasurementSystem measurementSystem;
-};
-
-QAbstractNavigator::QAbstractNavigator(QObject *parent)
- : QObject(parent)
- , d(new QAbstractNavigatorPrivate)
-{
-}
-
-QAbstractNavigator::~QAbstractNavigator()
-{
-}
-
-void QAbstractNavigator::setLocale(const QLocale &locale)
-{
- d->locale = locale;
-}
-
-QLocale QAbstractNavigator::locale() const
-{
- return d->locale;
-}
-
-void QAbstractNavigator::setMeasurementSystem(QLocale::MeasurementSystem system)
-{
- d->measurementSystem = system;
-}
-
-QLocale::MeasurementSystem QAbstractNavigator::measurementSystem() const
-{
- return d->measurementSystem;
-}
-
-QVariant QAbstractNavigator::nextManeuverIcon() const
-{
- return QVariant();
-}
-
-double QAbstractNavigator::distanceToNextManeuver() const
-{
- return qQNaN();
-}
-
-int QAbstractNavigator::timeToNextManeuver() const
-{
- return -1;
-}
-
-int QAbstractNavigator::remainingTravelTime() const
-{
- return -1;
-}
-
-double QAbstractNavigator::remainingTravelDistance() const
-{
- return qQNaN();
-}
-
-int QAbstractNavigator::remainingTravelTimeToNextWaypoint() const
-{
- return -1;
-}
-
-double QAbstractNavigator::remainingTravelDistanceToNextWaypoint() const
-{
- return qQNaN();
-}
-
-double QAbstractNavigator::traveledDistance() const
-{
- return 0;
-}
-
-int QAbstractNavigator::traveledTime() const
-{
- return 0;
-}
-
-QGeoRoute QAbstractNavigator::currentRoute() const
-{
- return QGeoRoute();
-}
-
-QGeoRouteLeg QAbstractNavigator::currentRouteLeg() const
-{
- return QGeoRouteLeg();
-}
-
-QList<QGeoRoute> QAbstractNavigator::alternativeRoutes() const
-{
- return QList<QGeoRoute>();
-}
-
-int QAbstractNavigator::currentSegment() const
-{
- return 0;
-}
-
-QNavigationManagerEngine::QNavigationManagerEngine(const QVariantMap &parameters, QObject *parent)
- : QObject(parent)
- , d(new QNavigationManagerEnginePrivate)
-{
- Q_UNUSED(parameters);
-}
-
-QNavigationManagerEngine::~QNavigationManagerEngine()
-{
-}
-
-void QNavigationManagerEngine::setManagerName(const QString &name)
-{
- d->managerName = name;
-}
-
-QString QNavigationManagerEngine::managerName() const
-{
- return d->managerName;
-}
-
-void QNavigationManagerEngine::setManagerVersion(int version)
-{
- d->managerVersion = version;
-}
-
-int QNavigationManagerEngine::managerVersion() const
-{
- return d->managerVersion;
-}
-
-void QNavigationManagerEngine::setLocale(const QLocale &locale)
-{
- d->locale = locale;
-}
-
-QLocale QNavigationManagerEngine::locale() const
-{
- return d->locale;
-}
-
-void QNavigationManagerEngine::setMeasurementSystem(QLocale::MeasurementSystem system)
-{
- d->measurementSystem = system;
-}
-
-QLocale::MeasurementSystem QNavigationManagerEngine::measurementSystem() const
-{
- return d->measurementSystem;
-}
-
-bool QNavigationManagerEngine::isInitialized() const
-{
- return d->initialized;
-}
-
-void QNavigationManagerEngine::engineInitialized()
-{
- d->initialized = true;
- emit initialized();
-}
-
-QT_END_NAMESPACE
diff --git a/src/location/maps/qnavigationmanagerengine_p.h b/src/location/maps/qnavigationmanagerengine_p.h
deleted file mode 100644
index e1c407c7..00000000
--- a/src/location/maps/qnavigationmanagerengine_p.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QNAVIGATIONMANAGERENGINE_H
-#define QNAVIGATIONMANAGERENGINE_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtLocation/private/qlocationglobal_p.h>
-#include <QObject>
-#include <QLocale>
-
-QT_BEGIN_NAMESPACE
-
-class QAbstractNavigatorPrivate;
-class QGeoMap;
-class QGeoMapParameter;
-class QMapRouteObject;
-class QGeoRoute;
-class QGeoRouteLeg;
-class QNavigationManager;
-class QNavigationManagerEnginePrivate;
-class QDeclarativeNavigatorParams;
-class QDeclarativeGeoWaypoint;
-class QDeclarativeGeoRouteLeg;
-class QDeclarativeGeoRoute;
-
-/*
- This class is not supposed to react on QDeclarativeNavigator properties changes.
- This class is meant to react only on start, stop and setTrackPosition.
- Upon start(), it is supposed to fetch all info from the QDeclarativeNavigatorParams that the engine is supposed
- to inject.
-*/
-class Q_LOCATION_PRIVATE_EXPORT QAbstractNavigator: public QObject
-{
- Q_OBJECT
-public:
- QAbstractNavigator(QObject *parent = nullptr);
- ~QAbstractNavigator() override;
- virtual void setLocale(const QLocale &locale);
- virtual QLocale locale() const;
- virtual void setMeasurementSystem(QLocale::MeasurementSystem system);
- virtual QLocale::MeasurementSystem measurementSystem() const;
- virtual bool active() const = 0;
- virtual bool ready() const = 0;
-
- virtual QVariant nextManeuverIcon() const;
- virtual double distanceToNextManeuver() const;
- virtual int timeToNextManeuver() const;
- virtual int remainingTravelTime() const;
- virtual double remainingTravelDistance() const;
- virtual int remainingTravelTimeToNextWaypoint() const;
- virtual double remainingTravelDistanceToNextWaypoint() const;
- virtual double traveledDistance() const;
- virtual int traveledTime() const;
- virtual QGeoRoute currentRoute() const;
- virtual QGeoRouteLeg currentRouteLeg() const;
- virtual QList<QGeoRoute> alternativeRoutes() const = 0;
- virtual int currentSegment() const;
- virtual void setAutomaticReroutingEnabled(bool autoRerouting) = 0;
- virtual bool automaticReroutingEnabled() const = 0; // configured via navigation params at construction time
- virtual bool isOnRoute() = 0;
- virtual void recalculateRoutes() = 0;
-
-public slots:
- virtual bool start() = 0;
- virtual bool stop() = 0;
- virtual void setTrackPosition(bool trackPosition) = 0;
-
-signals:
- // These must be emitted by the engine
- void activeChanged(bool active);
- void waypointReached(const QDeclarativeGeoWaypoint *pos);
- void destinationReached();
- void currentRouteChanged();
- void currentRouteLegChanged();
- void currentSegmentChanged();
-
- void nextManeuverIconChanged();
- void progressInformationChanged();
- void isOnRouteChanged();
- void alternativeRoutesChanged();
-
-private:
- std::unique_ptr<QAbstractNavigatorPrivate> d;
-};
-
-class Q_LOCATION_PRIVATE_EXPORT QNavigationManagerEngine : public QObject
-{
- Q_OBJECT
-public:
- explicit QNavigationManagerEngine(const QVariantMap &parameters, QObject *parent = nullptr);
- ~QNavigationManagerEngine() override;
-
- void setManagerName(const QString &name);
- QString managerName() const;
- void setManagerVersion(int version);
- int managerVersion() const;
- virtual void setLocale(const QLocale &locale);
- virtual QLocale locale() const;
- virtual void setMeasurementSystem(QLocale::MeasurementSystem system);
- virtual QLocale::MeasurementSystem measurementSystem() const;
-
- virtual bool isInitialized() const;
- virtual QAbstractNavigator *createNavigator(const QSharedPointer<QDeclarativeNavigatorParams> &navigator) = 0;
-
-signals:
- void initialized();
-
-protected:
- /*!
- Marks the engine as initialized. Subclasses of QGeoMappingManagerEngine are to
- call this method after performing implementation-specific initialization within
- the constructor.
- */
- virtual void engineInitialized();
-
- std::unique_ptr<QNavigationManagerEnginePrivate> d;
-};
-
-QT_END_NAMESPACE
-
-#endif // QNAVIGATIONMANAGERENGINE_H