summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/locationlabs/locationlabs.cpp2
-rw-r--r--src/location/labs/qdeclarativenavigator.cpp15
-rw-r--r--src/location/labs/qdeclarativenavigator_p.h3
3 files changed, 20 insertions, 0 deletions
diff --git a/src/imports/locationlabs/locationlabs.cpp b/src/imports/locationlabs/locationlabs.cpp
index bb511318..c90993eb 100644
--- a/src/imports/locationlabs/locationlabs.cpp
+++ b/src/imports/locationlabs/locationlabs.cpp
@@ -42,6 +42,7 @@
#include <QtLocation/private/qmappolylineobject_p.h>
#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>
@@ -76,6 +77,7 @@ public:
qmlRegisterType<QMapPolylineObject>(uri, major, minor, "MapPolylineObject");
qmlRegisterType<QDeclarativeNavigationBasicDirections>();
qmlRegisterType<QDeclarativeNavigator>(uri, major, minor, "Navigator");
+ qmlRegisterType<QAbstractNavigator>();
} else {
qDebug() << "Unsupported URI given to load location QML plugin: " << QLatin1String(uri);
}
diff --git a/src/location/labs/qdeclarativenavigator.cpp b/src/location/labs/qdeclarativenavigator.cpp
index 2fab9144..5dfdfdbe 100644
--- a/src/location/labs/qdeclarativenavigator.cpp
+++ b/src/location/labs/qdeclarativenavigator.cpp
@@ -297,6 +297,21 @@ QString QDeclarativeNavigator::errorString() const
return d_ptr->m_errorString;
}
+/* !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.
+
+ \note Using this property leads to writing code that won't work with different plugins.
+*/
+QAbstractNavigator *QDeclarativeNavigator::abstractNavigator() const
+{
+ return d_ptr->m_navigator.data();
+
+}
+
bool QDeclarativeNavigator::active() const
{
return d_ptr->m_active;
diff --git a/src/location/labs/qdeclarativenavigator_p.h b/src/location/labs/qdeclarativenavigator_p.h
index 17f8e687..e12d6ba4 100644
--- a/src/location/labs/qdeclarativenavigator_p.h
+++ b/src/location/labs/qdeclarativenavigator_p.h
@@ -69,6 +69,7 @@ class QGeoRouteSegment;
class QDeclarativeNavigatorPrivate;
class QDeclarativeGeoRouteSegment;
class QDeclarativeNavigationBasicDirections;
+class QAbstractNavigator;
class Q_LOCATION_PRIVATE_EXPORT QDeclarativeNavigator : public QParameterizableObject, public QQmlParserStatus
{
@@ -83,6 +84,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeNavigator : public QParameterizableO
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)
@@ -133,6 +135,7 @@ public:
bool trackPositionSource() const;
QDeclarativeNavigationBasicDirections *directions() const;
+ QAbstractNavigator *abstractNavigator() const;
NavigationError error() const;
QString errorString() const;