summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-08-30 15:07:08 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-01 11:56:47 +0200
commitda10ee9b67aaf0c9218c2b891efa06b323866470 (patch)
tree1ee258c51a87d04ce759c09d039bea00dfd0410c /tests
parent7b3531ec887fdd2ccdd26d904757a314aed6e352 (diff)
downloadqtlocation-da10ee9b67aaf0c9218c2b891efa06b323866470.tar.gz
Remove QDeclarativeGeoManeuver
Register the QGeoManeuver type directly as the RouteManeuver QML type, and use it in QDeclarativeGeoRouteSegment. The type is now uncreatable. It wasn't in Qt 5.15, but since there is no setter-API that is exposed to QML (QDeclarativeGeoRouteSegment::maneuver is a read-only property tagged as CONSTANT), there is no point in creating a RouteManeuver object in QML anyway. The QML tests can get a default-created QGeoManeuever from an empty route segment. Document the C++ properties via \property, move the QML type documentation into the qgeomaneuver.cpp file, and unify the language. Note: The QML type should be routeManeuver, as value types should start with a lower-case character. If we make that change, it will be in a separate, compatibility-breaking commit for all the value types. Pick-to: 6.2 Change-Id: I277e7011f2082e2da9e0141db9bad0a60a524c88 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative_location_core/tst_routing.qml5
-rw-r--r--tests/auto/qgeomaneuver/tst_qgeomaneuver.h1
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/declarative_location_core/tst_routing.qml b/tests/auto/declarative_location_core/tst_routing.qml
index 0c30fb43..2540a54c 100644
--- a/tests/auto/declarative_location_core/tst_routing.qml
+++ b/tests/auto/declarative_location_core/tst_routing.qml
@@ -78,7 +78,6 @@ Item {
TestCase {
name: "RouteManeuver RouteSegment and MapRoute"
RouteSegment {id: emptySegment}
- RouteManeuver {id: emptyManeuver}
// TODO enable when we have map route
//MapRoute {id: emptyMapRoute}
@@ -136,14 +135,16 @@ Item {
}
function test_routesegment_defaults() {
+ let emptyManeuver = emptySegment.maneuver
compare(emptySegment.travelTime, 0)
compare(emptySegment.distance, 0)
compare(emptySegment.path.length, 0)
compare(emptySegment.maneuver.valid, emptyManeuver.valid)
compare(emptySegment.maneuver.instructionText, emptyManeuver.instructionText)
- compare(emptySegment.maneuver.waypointValid, emptyManeuver.waypointValid)
+ compare(emptySegment.maneuver.waypoint.valid, emptyManeuver.waypoint.valid)
}
function test_maneuver_defaults() {
+ let emptyManeuver = emptySegment.maneuver
compare(emptyManeuver.valid, false)
compare(emptyManeuver.instructionText, "")
compare(emptyManeuver.direction, RouteManeuver.NoDirection)
diff --git a/tests/auto/qgeomaneuver/tst_qgeomaneuver.h b/tests/auto/qgeomaneuver/tst_qgeomaneuver.h
index 87168838..41c704e8 100644
--- a/tests/auto/qgeomaneuver/tst_qgeomaneuver.h
+++ b/tests/auto/qgeomaneuver/tst_qgeomaneuver.h
@@ -67,7 +67,6 @@ private Q_SLOTS:
};
Q_DECLARE_METATYPE( QList<double>);
-Q_DECLARE_METATYPE (QGeoManeuver::InstructionDirection);
#endif // TST_QGEOMANEUVER_H