diff options
Diffstat (limited to 'src/location/labs')
-rw-r--r-- | src/location/labs/qdeclarativenavigator.cpp | 28 | ||||
-rw-r--r-- | src/location/labs/qdeclarativenavigator_p.h | 5 | ||||
-rw-r--r-- | src/location/labs/qdeclarativenavigator_p_p.h | 1 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/location/labs/qdeclarativenavigator.cpp b/src/location/labs/qdeclarativenavigator.cpp index 5fe36bb8..7dba341e 100644 --- a/src/location/labs/qdeclarativenavigator.cpp +++ b/src/location/labs/qdeclarativenavigator.cpp @@ -126,6 +126,19 @@ QT_BEGIN_NAMESPACE */ /*! + \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 Route Qt.labs.location::Navigator::currentRoute This read-only property holds the current route the navigator following. @@ -284,6 +297,21 @@ bool QDeclarativeNavigator::navigatorReady() const return d_ptr->m_ready; } +bool QDeclarativeNavigator::trackPositionSource() const +{ + return d_ptr->m_trackPositionSource; +} + +void QDeclarativeNavigator::setTrackPositionSource(bool trackPositionSource) +{ + if (trackPositionSource == d_ptr->m_trackPositionSource) + return; + + d_ptr->m_trackPositionSource = trackPositionSource; + + emit trackPositionSourceChanged(trackPositionSource); +} + QDeclarativeGeoRoute *QDeclarativeNavigator::currentRoute() const { if (!d_ptr->m_ready || !d_ptr->m_navigationManager->active()) diff --git a/src/location/labs/qdeclarativenavigator_p.h b/src/location/labs/qdeclarativenavigator_p.h index 0373bf57..3c83ec94 100644 --- a/src/location/labs/qdeclarativenavigator_p.h +++ b/src/location/labs/qdeclarativenavigator_p.h @@ -75,6 +75,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeNavigator : public QParameterizableO 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(QDeclarativeGeoRoute *currentRoute READ currentRoute NOTIFY currentRouteChanged) Q_PROPERTY(int currentSegment READ currentSegment NOTIFY currentSegmentChanged) Q_INTERFACES(QQmlParserStatus) @@ -109,11 +110,15 @@ public: QNavigationManager *navigationManager() const; bool navigatorReady() const; + void setTrackPositionSource(bool trackPositionSource); + bool trackPositionSource() const; + QDeclarativeGeoRoute *currentRoute() const; int currentSegment() const; signals: void navigatorReadyChanged(bool ready); + void trackPositionSourceChanged(bool trackPositionSource); void activeChanged(bool active); void waypointReached(const QDeclarativeGeoWaypoint *pos); void destinationReached(); diff --git a/src/location/labs/qdeclarativenavigator_p_p.h b/src/location/labs/qdeclarativenavigator_p_p.h index c4198714..3710054e 100644 --- a/src/location/labs/qdeclarativenavigator_p_p.h +++ b/src/location/labs/qdeclarativenavigator_p_p.h @@ -84,6 +84,7 @@ public: bool m_active = false; bool m_completed = false; bool m_ready = false; + bool m_trackPositionSource = true; }; QT_END_NAMESPACE |