diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-11-28 19:38:10 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-12-04 16:11:50 +0000 |
commit | 4919bb49039dd84bd58290fb66e2c272a920929c (patch) | |
tree | 79469376d4b2ec7c86194455f5d32c6c88126a9e /tests/auto/declarative_core | |
parent | 9ec2fa87650607337f1692b7bc52e16cc3f74860 (diff) | |
download | qtlocation-4919bb49039dd84bd58290fb66e2c272a920929c.tar.gz |
Provide extended, plugin dependent information for Geo Locations
This includes support for osm geojson and class fields.
At the present, the content of the geojson field is returned
as is.
As soon as QGeoJson support is finalized, this will be
integrated with a QGeoPolygon.
Fixes: QTBUG-43401
Change-Id: Ifa7e24cf904a2c1e1e77ebfaa7948ac0ce81d265
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests/auto/declarative_core')
-rw-r--r-- | tests/auto/declarative_core/tst_geocoding.qml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/declarative_core/tst_geocoding.qml b/tests/auto/declarative_core/tst_geocoding.qml index 1eadf870..16843528 100644 --- a/tests/auto/declarative_core/tst_geocoding.qml +++ b/tests/auto/declarative_core/tst_geocoding.qml @@ -272,6 +272,14 @@ Item { ] } + Plugin { + id: extendedPlugin; + name: "qmlgeo.test.plugin"; + allowExperimental: true + PluginParameter { name: "finishRequestImmediately"; value: false} + PluginParameter { name: "includeExtendedData"; value: true } + } + GeocodeModel {id: testModel; plugin: testPlugin2} SignalSpy {id: locationsSpy; target: testModel; signalName: "locationsChanged"} SignalSpy {id: countSpy; target: testModel; signalName: "countChanged"} @@ -297,6 +305,9 @@ Item { GeocodeModel {id: automaticModel; plugin: autoPlugin; query: automaticAddress1; autoUpdate: true} SignalSpy {id: automaticLocationsSpy; target: automaticModel; signalName: "locationsChanged"} + GeocodeModel {id: extendedModel; plugin: extendedPlugin; query: automaticAddress1; autoUpdate: true} + SignalSpy {id: extendedLocationsSpy; target: extendedModel; signalName: "locationsChanged"} + TestCase { name: "GeocodeModelGeocoding" function clear_slack_model() { @@ -546,6 +557,19 @@ Item { compare (automaticModel.count, 3) } + function test_geocode_extended_attributes() { + compare (extendedModel.count, 6) // should be something already + compare (extendedLocationsSpy.count, 3) + compare(extendedModel.get(0).extendedAttributes + ["QGeoCodingManagerEngineTest_locationExtendedAttribute"], 42) + // change query and its contents and verify that autoupdate occurs + extendedModel.query = automaticCoordinate1 + tryCompare(extendedLocationsSpy, "count", 4) + compare (extendedModel.count, 3) + compare(extendedModel.get(0).extendedAttributes + ["QGeoCodingManagerEngineTest_locationExtendedAttribute"], 42) + } + function test_delayed_geocode() { // basic delayed response slackModel.reset() |