summaryrefslogtreecommitdiff
path: root/examples/location
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-08-19 14:29:06 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-08-19 14:29:06 +0200
commit1e9eb569c57c08f0eaa79a9afeb57402271f11b1 (patch)
treee8e5c5befba04e9d10ec84e8d829076838905ac5 /examples/location
parent33d57f8018535dfe4ac316fc0f2ebe69fb5ade1c (diff)
parentd1c91515ef0ad4208c41a4052f92bfb817333aca (diff)
downloadqtlocation-1e9eb569c57c08f0eaa79a9afeb57402271f11b1.tar.gz
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts: src/imports/location/qquickgeomapgesturearea.cpp Change-Id: If115a052678b140eee46b8c0d9471b7d96953915
Diffstat (limited to 'examples/location')
-rw-r--r--examples/location/places_list/Marker.qml59
-rw-r--r--examples/location/places_list/marker.pngbin0 -> 1051 bytes
-rw-r--r--examples/location/places_list/places_list.pro2
-rw-r--r--examples/location/places_list/places_list.qml19
-rw-r--r--examples/location/places_list/places_list.qrc (renamed from examples/location/places_list/resources.qrc)2
-rw-r--r--examples/location/places_map/marker.pngbin2341 -> 1051 bytes
-rw-r--r--examples/location/places_map/places_map.pro2
-rw-r--r--examples/location/places_map/places_map.qml22
-rw-r--r--examples/location/places_map/places_map.qrc (renamed from examples/location/places_map/places_map_resource.qrc)0
9 files changed, 85 insertions, 21 deletions
diff --git a/examples/location/places_list/Marker.qml b/examples/location/places_list/Marker.qml
new file mode 100644
index 00000000..7b73cde9
--- /dev/null
+++ b/examples/location/places_list/Marker.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ width: image.width
+ Image {
+ id: image
+ anchors.centerIn: parent
+ source: "marker.png"
+ Text{
+ y: parent.height/10
+ width: parent.width
+ color: "white"
+ font.bold: true
+ font.pixelSize: 14
+ horizontalAlignment: Text.AlignHCenter
+ text: index
+ }
+ }
+}
diff --git a/examples/location/places_list/marker.png b/examples/location/places_list/marker.png
new file mode 100644
index 00000000..d5c698d1
--- /dev/null
+++ b/examples/location/places_list/marker.png
Binary files differ
diff --git a/examples/location/places_list/places_list.pro b/examples/location/places_list/places_list.pro
index b120f4aa..82aa4337 100644
--- a/examples/location/places_list/places_list.pro
+++ b/examples/location/places_list/places_list.pro
@@ -5,7 +5,7 @@ QT += quick qml network positioning location
SOURCES = main.cpp
RESOURCES += \
- resources.qrc
+ places_list.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/location/places_list
INSTALLS += target
diff --git a/examples/location/places_list/places_list.qml b/examples/location/places_list/places_list.qml
index a15914e9..791d0aaf 100644
--- a/examples/location/places_list/places_list.qml
+++ b/examples/location/places_list/places_list.qml
@@ -40,14 +40,14 @@
//! [Imports]
import QtQuick 2.0
-import QtPositioning 5.2
-import QtLocation 5.3
+import QtPositioning 5.5
+import QtLocation 5.5
//! [Imports]
Rectangle {
width: 360
- height: 360
- property variant startCoordinate: QtPositioning.coordinate(-27.46778, 153.02778)
+ height: 640
+ property variant startCoordinate: QtPositioning.coordinate( 59.9485, 10.7686) // The Qt Company in Oslo
//! [Initialize Plugin]
Plugin {
@@ -79,12 +79,15 @@ Rectangle {
anchors.fill: parent
model: searchModel
delegate: Component {
- Column {
- Text { text: title }
- Text { text: place.location.address.text }
+ Row {
+ spacing: 5
+ Marker { height: parent.height }
+ Column {
+ Text { text: title; font.bold: true }
+ Text { text: place.location.address.text }
+ }
}
}
- spacing: 10
}
//! [Places ListView]
diff --git a/examples/location/places_list/resources.qrc b/examples/location/places_list/places_list.qrc
index 4cc332e2..19a0ff59 100644
--- a/examples/location/places_list/resources.qrc
+++ b/examples/location/places_list/places_list.qrc
@@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/">
+ <file>marker.png</file>
<file>places_list.qml</file>
+ <file>Marker.qml</file>
</qresource>
</RCC>
diff --git a/examples/location/places_map/marker.png b/examples/location/places_map/marker.png
index 86ec960e..d5c698d1 100644
--- a/examples/location/places_map/marker.png
+++ b/examples/location/places_map/marker.png
Binary files differ
diff --git a/examples/location/places_map/places_map.pro b/examples/location/places_map/places_map.pro
index 140ddf44..51d61bbc 100644
--- a/examples/location/places_map/places_map.pro
+++ b/examples/location/places_map/places_map.pro
@@ -5,7 +5,7 @@ QT += quick qml network positioning location
SOURCES = main.cpp
RESOURCES += \
- places_map_resource.qrc
+ places_map.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/location/places_map
INSTALLS += target
diff --git a/examples/location/places_map/places_map.qml b/examples/location/places_map/places_map.qml
index d59ac642..7ff3706a 100644
--- a/examples/location/places_map/places_map.qml
+++ b/examples/location/places_map/places_map.qml
@@ -40,13 +40,13 @@
//! [Imports]
import QtQuick 2.0
-import QtPositioning 5.2
-import QtLocation 5.3
+import QtPositioning 5.5
+import QtLocation 5.5
//! [Imports]
Rectangle {
width: 360
- height: 360
+ height: 640
//! [Initialize Plugin]
Plugin {
@@ -62,7 +62,7 @@ Rectangle {
//! [Current Location]
PositionSource {
id: positionSource
- property variant lastSearchPosition: locationBrisbane
+ property variant lastSearchPosition: locationOslo
active: true
updateInterval: 120000 // 2 mins
onPositionChanged: {
@@ -80,15 +80,15 @@ Rectangle {
//! [Current Location]
//! [PlaceSearchModel]
- property variant locationBrisbane: QtPositioning.coordinate(-27.47, 153.025)
+ property variant locationOslo: QtPositioning.coordinate( 59.93, 10.76)
+
PlaceSearchModel {
id: searchModel
plugin: myPlugin
searchTerm: "Pizza"
- //initially show Brisbane
- searchArea: QtPositioning.circle(locationBrisbane)
+ searchArea: QtPositioning.circle(locationOslo)
Component.onCompleted: update()
}
@@ -99,7 +99,7 @@ Rectangle {
id: map
anchors.fill: parent
plugin: myPlugin;
- center: locationBrisbane
+ center: locationOslo
zoomLevel: 13
MapItemView {
@@ -110,9 +110,9 @@ Rectangle {
anchorPoint.x: image.width * 0.5
anchorPoint.y: image.height
- sourceItem: Image {
- id: image
- source: "marker.png"
+ sourceItem: Column {
+ Image { id: image; source: "marker.png" }
+ Text { text: title; font.bold: true }
}
}
}
diff --git a/examples/location/places_map/places_map_resource.qrc b/examples/location/places_map/places_map.qrc
index 22395296..22395296 100644
--- a/examples/location/places_map/places_map_resource.qrc
+++ b/examples/location/places_map/places_map.qrc