diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-06-01 23:15:51 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-06-26 14:28:28 +0000 |
commit | 8e6ec8c3075d403065e3bf874fd6680945126298 (patch) | |
tree | 998d73165dae586240bb2b4867e27a9765df995a /src/location/declarativemaps | |
parent | 9cdf0e046cbe1c850ce73a4590c50d85d050b4ec (diff) | |
download | qtlocation-8e6ec8c3075d403065e3bf874fd6680945126298.tar.gz |
Add QDeclarativeGeoRoute::equals
So that deep comparisons can be performed in QML too
Change-Id: I484644d4ddf3334c16321e5fc361504e9de105b2
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeoroute.cpp | 12 | ||||
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeoroute_p.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeoroute.cpp b/src/location/declarativemaps/qdeclarativegeoroute.cpp index 95a26a32..0e411361 100644 --- a/src/location/declarativemaps/qdeclarativegeoroute.cpp +++ b/src/location/declarativemaps/qdeclarativegeoroute.cpp @@ -321,4 +321,16 @@ QDeclarativeGeoRouteQuery *QDeclarativeGeoRoute::routeQuery() return routeQuery_; } +/*! + \qmlmethod bool QtLocation::Route::equals(Route other) + + This method performs deep comparison. + + \since 5.12 +*/ +bool QDeclarativeGeoRoute::equals(QDeclarativeGeoRoute *other) const +{ + return route_ == other->route_; +} + QT_END_NAMESPACE diff --git a/src/location/declarativemaps/qdeclarativegeoroute_p.h b/src/location/declarativemaps/qdeclarativegeoroute_p.h index c19c2674..fa9025d8 100644 --- a/src/location/declarativemaps/qdeclarativegeoroute_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroute_p.h @@ -90,6 +90,8 @@ public: const QGeoRoute &route() const; QDeclarativeGeoRouteQuery *routeQuery(); + Q_INVOKABLE bool equals(QDeclarativeGeoRoute *other) const; + Q_SIGNALS: void pathChanged(); |