summaryrefslogtreecommitdiff
path: root/src/location/doc/snippets/declarative/places.qml
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-02-20 15:43:08 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-02-25 08:01:23 +0000
commit351e07dc2c96f70867dca6aaf7d2eb2919ba3d01 (patch)
treeb4ae04117d6d8657b4b9a4886bab2e658dfcf3f9 /src/location/doc/snippets/declarative/places.qml
parentebf8bfec10bae10f14e03bee58b23915540490a2 (diff)
downloadqtlocation-351e07dc2c96f70867dca6aaf7d2eb2919ba3d01.tar.gz
Fix QtLocation QML snippets
Most of the snippets did not work and/or had outdated API usage. Change-Id: Ib8949ab6d007c4eaa3638fb40473bf6d217edd36 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/location/doc/snippets/declarative/places.qml')
-rw-r--r--src/location/doc/snippets/declarative/places.qml25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/location/doc/snippets/declarative/places.qml b/src/location/doc/snippets/declarative/places.qml
index fdd2a981..f85a3a8f 100644
--- a/src/location/doc/snippets/declarative/places.qml
+++ b/src/location/doc/snippets/declarative/places.qml
@@ -47,6 +47,7 @@ import QtLocation 5.3
//! [QtLocation import]
Item {
+ width: 400; height: 400;
Plugin {
id: myPlugin
}
@@ -137,7 +138,7 @@ Item {
plugin: myPlugin
// Brisbane
- searchArea: QtLocation.circle(QtLocation.coordinate(-27.46778, 153.02778))
+ searchArea: QtPositioning.circle(QtPositioning.coordinate(-27.46778, 153.02778))
onSearchTermChanged: update()
}
@@ -328,24 +329,6 @@ Item {
}
//! [Place savePlace def]
-
- //! [Search MapItemView]
- MapItemView {
- model: searchModel
- delegate: MapQuickItem {
- coordinate: place.location.coordinate
-
- anchorPoint.x: image.width * 0.5
- anchorPoint.y: image.height
-
- sourceItem: Image {
- id: image
- source: "marker.png"
- }
- }
- }
- //! [Search MapItemView]
-
function fetchDetails() {
//! [Place fetchDetails]
if (!place.detailsFetched)
@@ -380,7 +363,7 @@ Item {
function saveToNewPlugin() {
//! [Place save to different plugin]
- place = Qt.createQmlObject('import QtLocation 5.3; Place { }', parent);
+ var place = Qt.createQmlObject('import QtLocation 5.3; Place { }', parent);
place.plugin = destinationPlugin;
place.copyFrom(originalPlace);
place.save();
@@ -423,7 +406,7 @@ Item {
//! [Place favorite]
function saveFavorite() {
- var place;
+ var place = Qt.createQmlObject('import QtLocation 5.3; Place { }', parent);
var destinationPlugin
//! [Place saveFavorite]
place.initializeFavorite(destinationPlugin);