diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-11-22 16:05:07 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-11-26 11:39:40 +0000 |
commit | fb23882d5bc697b2dfdd22c27d34c52d889d1200 (patch) | |
tree | e33a0aa9c2bc97d823aa7c43630eaf5fb932466f | |
parent | d94b6781250ace51e9a857a80ff575be566fcf94 (diff) | |
download | qtlocation-fb23882d5bc697b2dfdd22c27d34c52d889d1200.tar.gz |
Add QAbstractNavigator::setTrackPosition
Or else there's no reactive way to tell navigator objects when the user
changes this property.
Change-Id: Ief78facf537a50c15611127c5282c2bcfd59f8fd
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
-rw-r--r-- | src/location/labs/qdeclarativenavigator.cpp | 7 | ||||
-rw-r--r-- | src/location/labs/qdeclarativenavigator_p_p.h | 2 | ||||
-rw-r--r-- | src/location/maps/qnavigationmanagerengine_p.h | 1 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/location/labs/qdeclarativenavigator.cpp b/src/location/labs/qdeclarativenavigator.cpp index b06681d9..0bf5035f 100644 --- a/src/location/labs/qdeclarativenavigator.cpp +++ b/src/location/labs/qdeclarativenavigator.cpp @@ -296,15 +296,15 @@ bool QDeclarativeNavigator::navigatorReady() const bool QDeclarativeNavigator::trackPositionSource() const { - return d_ptr->m_trackPositionSource; + return d_ptr->m_params->m_trackPositionSource; } void QDeclarativeNavigator::setTrackPositionSource(bool trackPositionSource) { - if (trackPositionSource == d_ptr->m_trackPositionSource) + if (trackPositionSource == d_ptr->m_params->m_trackPositionSource) return; - d_ptr->m_trackPositionSource = trackPositionSource; + d_ptr->m_params->m_trackPositionSource = trackPositionSource; emit trackPositionSourceChanged(trackPositionSource); } @@ -414,6 +414,7 @@ bool QDeclarativeNavigator::ensureEngine() d_ptr->m_active = active; emit activeChanged(active); }); + connect(this, &QDeclarativeNavigator::trackPositionSourceChanged, d_ptr->m_navigator.get(), &QAbstractNavigator::setTrackPosition); emit navigatorReadyChanged(true); return true; } diff --git a/src/location/labs/qdeclarativenavigator_p_p.h b/src/location/labs/qdeclarativenavigator_p_p.h index 6c07a0ca..229ead1e 100644 --- a/src/location/labs/qdeclarativenavigator_p_p.h +++ b/src/location/labs/qdeclarativenavigator_p_p.h @@ -73,6 +73,7 @@ public: QGeoRoute m_geoRoute; QPointer<QDeclarativePositionSource> m_positionSource; QList<QPointer<QGeoMapParameter>> m_parameters; + bool m_trackPositionSource = true; }; class QDeclarativeNavigatorPrivate @@ -90,7 +91,6 @@ public: bool m_active = false; bool m_completed = false; bool m_ready = false; - bool m_trackPositionSource = true; }; QT_END_NAMESPACE diff --git a/src/location/maps/qnavigationmanagerengine_p.h b/src/location/maps/qnavigationmanagerengine_p.h index 62d9eb87..0852b3ea 100644 --- a/src/location/maps/qnavigationmanagerengine_p.h +++ b/src/location/maps/qnavigationmanagerengine_p.h @@ -81,6 +81,7 @@ public: public slots: virtual bool start() = 0; virtual bool stop() = 0; + virtual void setTrackPosition(bool trackPosition) = 0; signals: // These must be emitted by the engine |