summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorabcd <qt_abcd1@ovi.com>2011-07-14 10:30:21 +1000
committerabcd <qt_abcd1@ovi.com>2011-07-19 05:58:11 +0200
commit4a7323e7f05d04e64f02e1f88d1709c90358f782 (patch)
treedbcfe30f67950c5e49d8710cbdce9adc98917da7 /examples
parent536f8109acf7ceb021b8afdea71d087f27610cc9 (diff)
downloadqtlocation-4a7323e7f05d04e64f02e1f88d1709c90358f782.tar.gz
Have QPlaceSearchQuery use a search area instead of coord or box
The original QPlaceSearchQuery accepts a coordinate or a boundingbox to try narrow down the search. When both coordinate and boundingbox are set, it is ambiguous as to which one is used. Also there wasn't a way to specify a radius. Instead we provide a single bounding area to eliminate any confusion. Currently the bounding area can either be a circle or box. Also add in a clone function for QGeoBoundingArea, this is so we can pass clones into the QPlaceSearchQuery which takes ownership of the search area. The QPlaceSearchQuery takes ownership so that queries can be easily created and destroyed on the stack, (if the developer chooses do so, this is not mandatory) otherwise developers would have to explicitly delete the search area. This change does not address the issue of propagating notifications. eg when a coord of a bounding box is changed, then notifications that the area has changed should also be made. Change-Id: I62656a6562d251e85ff967e96b2a4cbdb3cf7042 Reviewed-on: http://codereview.qt.nokia.com/1634 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com> Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/qmlplaces/qmlplaces.qml21
1 files changed, 12 insertions, 9 deletions
diff --git a/examples/declarative/qmlplaces/qmlplaces.qml b/examples/declarative/qmlplaces/qmlplaces.qml
index 55fb83b3..3f502cee 100644
--- a/examples/declarative/qmlplaces/qmlplaces.qml
+++ b/examples/declarative/qmlplaces/qmlplaces.qml
@@ -6,12 +6,6 @@ Rectangle {
width: 640
height: 360
- property Coordinate searchCoordinate: Coordinate {
- // Brisbane
- longitude: 153.02778
- latitude: -27.46778
- }
-
Text {
id: queryText
text: "Query:"
@@ -202,7 +196,16 @@ Rectangle {
SearchResultModel {
id: resultModel
- searchCenter: searchCoordinate
+ searchArea: BoundingCircle {
+ id: proximity
+ center: Coordinate {
+ id: searchCoordinate
+ // Brisbane
+ longitude: 153.02778
+ latitude: -27.46778
+ }
+ radius:5000
+ }
didYouMean: 5
//onQueryFinished: console.log("datareceived " + error)
}
@@ -227,7 +230,7 @@ Rectangle {
TextPredictionModel {
id: resultSuggestion
- searchCenter: searchCoordinate
+ searchArea: proximity
offset: 0
limit: 15
searchTerm: search_term.text
@@ -235,7 +238,7 @@ Rectangle {
RecommendationModel {
id: recommendationModel
- searchCenter: searchCoordinate
+ searchArea: proximity
offset: 0
limit: 15
//onQueryFinished: console.log("datareceived " + error)