summaryrefslogtreecommitdiff
path: root/examples/location/places/content/places
diff options
context:
space:
mode:
Diffstat (limited to 'examples/location/places/content/places')
-rw-r--r--examples/location/places/content/places/CategoryDelegate.qml106
-rw-r--r--examples/location/places/content/places/CategoryView.qml87
-rw-r--r--examples/location/places/content/places/EditorialDelegate.qml89
-rw-r--r--examples/location/places/content/places/EditorialPage.qml93
-rw-r--r--examples/location/places/content/places/Group.qml67
-rw-r--r--examples/location/places/content/places/MapComponent.qml237
-rw-r--r--examples/location/places/content/places/OptionsDialog.qml120
-rw-r--r--examples/location/places/content/places/PlaceDelegate.qml209
-rw-r--r--examples/location/places/content/places/PlaceEditorials.qml58
-rw-r--r--examples/location/places/content/places/PlaceImages.qml149
-rw-r--r--examples/location/places/content/places/PlaceReviews.qml58
-rw-r--r--examples/location/places/content/places/PlacesUtils.js12
-rw-r--r--examples/location/places/content/places/RatingView.qml55
-rw-r--r--examples/location/places/content/places/ReviewDelegate.qml101
-rw-r--r--examples/location/places/content/places/ReviewPage.qml104
-rw-r--r--examples/location/places/content/places/SearchBox.qml244
-rw-r--r--examples/location/places/content/places/SearchResultDelegate.qml191
-rw-r--r--examples/location/places/content/places/SearchResultView.qml239
18 files changed, 0 insertions, 2219 deletions
diff --git a/examples/location/places/content/places/CategoryDelegate.qml b/examples/location/places/content/places/CategoryDelegate.qml
deleted file mode 100644
index e12efd2f..00000000
--- a/examples/location/places/content/places/CategoryDelegate.qml
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-import QtLocation.examples 5.0
-
-Item {
- id: root
-
- property bool showChildren: true
-
- signal clicked
- signal arrowClicked
-
- width: parent.width
- height: textItem.height
-
- Item {
- id: textItem
- anchors.left: parent.left
- anchors.right: arrow.left
- anchors.verticalCenter: parent.verticalCenter
-
- height: Math.max(icon.height, name.height)
-
- Image {
- id: icon
-
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- source: category.icon.url()
- }
-
- //! [CategoryModel delegate text]
- Text {
- id: name
-
- anchors.left: icon.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
-
- verticalAlignment: Text.AlignVCenter
-
- text: category.name
- elide: Text.ElideRight
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: root.clicked()
- }
- //! [CategoryModel delegate text]
- }
-
- IconButton {
- id: arrow
-
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- visible: model.hasModelChildren && showChildren
-
- source: "../../resources/right.png"
- pressedSource: "../../resources/right_pressed.png"
-
- onClicked: root.arrowClicked()
- }
- //! [CategoryModel delegate icon]
-}
diff --git a/examples/location/places/content/places/CategoryView.qml b/examples/location/places/content/places/CategoryView.qml
deleted file mode 100644
index 18495f73..00000000
--- a/examples/location/places/content/places/CategoryView.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-import QtLocation.examples 5.0
-
-
-//! [CategoryModel view 1]
-ListView {
- id: root
-
- property bool showChildren: true
-
- signal categoryClicked(variant category)
-//! [CategoryModel view 1]
-
- anchors.topMargin: 10
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.right: parent.right
- anchors.rightMargin: 10
-
- clip: true
- snapMode: ListView.SnapToItem
- spacing: 5
-
-//! [CategoryModel view 2]
- header: IconButton {
- source: "../../resources/left.png"
- pressedSource: "../../resources/left_pressed.png"
- onClicked: categoryListModel.rootIndex = categoryListModel.parentModelIndex()
- }
-//! [CategoryModel view 2]
-
-//! [CategoryModel view 3]
- model: VisualDataModel {
- id: categoryListModel
- model: categoryModel
- delegate: CategoryDelegate {
- id: categoryDelegate
-
- showChildren: root.showChildren
-
- onClicked: root.categoryClicked(category);
- onArrowClicked: categoryListModel.rootIndex = categoryListModel.modelIndex(index)
- }
- }
-}
-//! [CategoryModel view 3]
diff --git a/examples/location/places/content/places/EditorialDelegate.qml b/examples/location/places/content/places/EditorialDelegate.qml
deleted file mode 100644
index ef15c171..00000000
--- a/examples/location/places/content/places/EditorialDelegate.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-
-Item {
- id: root
-
- width: parent.width
- height: icon.height + 8
-
- Image {
- id: icon
-
- width: 64
- height: 64
-
- anchors.verticalCenter: root.verticalCenter
- anchors.left: root.left
- anchors.leftMargin: 4
-
- source: supplier.icon.url(Qt.size(64, 64), Icon.List)
- fillMode: Image.PreserveAspectFit
- }
-
- Text {
- anchors.top: icon.top
- anchors.topMargin: 4
- anchors.left: icon.right
- anchors.leftMargin: 4
- anchors.right: root.right
- anchors.rightMargin: 4
-
- text: model.title.length > 0 ? model.title : qsTr("Untitled editorial")
- font.bold: true
- font.pixelSize: 16
-
- wrapMode: Text.WordWrap
- elide: Text.ElideRight
- maximumLineCount: 2
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- placeContent.source = "";
- placeContent.data = model;
- placeContent.source = "EditorialPage.qml";
- }
- }
-}
diff --git a/examples/location/places/content/places/EditorialPage.qml b/examples/location/places/content/places/EditorialPage.qml
deleted file mode 100644
index c71af9e3..00000000
--- a/examples/location/places/content/places/EditorialPage.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-
-Item {
- anchors.fill: parent
-
- property variant d: parent ? parent.data : null
-
- Flickable {
- anchors.fill: parent
-
- contentHeight: c.height
- contentWidth: width
-
- Column {
- id: c
-
- width: parent.width
- clip: true
-
- Text {
- text: d ? d.title : ""
- width: parent.width
- wrapMode: Text.WordWrap
- font.pixelSize: 24
- }
-
- Text {
- text: d ? d.text : ""
- width: parent.width
- wrapMode: Text.WordWrap
- font.pixelSize: 20
- }
-
- Row {
- Image {
- width: 16
- height: 16
-
- source: d ? d.supplier.icon.url(Qt.size(width, height), Icon.List) : ""
- }
- Text {
- text: d ? d.supplier.name : ""
- font.pixelSize: 16
- }
- }
- Text {
- text: d ? d.supplier.url : ""
- font.pixelSize: 16
- }
- }
- }
-}
diff --git a/examples/location/places/content/places/Group.qml b/examples/location/places/content/places/Group.qml
deleted file mode 100644
index 872d45bf..00000000
--- a/examples/location/places/content/places/Group.qml
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** 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
-
-Item {
- id: item1
- width: parent.width
- height: childrenRect.height + 3
-
- property alias text: heading.text
-
- Text {
- id: heading
- text: '#heading#'
- anchors.left: parent.left
- }
-
- Rectangle {
- id: rectangle1
- width: parent.width
- height: 1
- radius: 1
- border.width: 1
- border.color: "#808080"
- anchors.top: heading.bottom
- anchors.topMargin: 3
- anchors.horizontalCenter: parent.horizontalCenter
- }
-}
diff --git a/examples/location/places/content/places/MapComponent.qml b/examples/location/places/content/places/MapComponent.qml
deleted file mode 100644
index 3b4d7500..00000000
--- a/examples/location/places/content/places/MapComponent.qml
+++ /dev/null
@@ -1,237 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtPositioning 5.2
-import QtLocation 5.3
-import QtLocation.examples 5.0
-
-Map {
- id: map
- zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
- center {
- // Brisbane
- latitude: -27.5
- longitude: 153
- }
-
- gesture.flickDeceleration: 3000
- gesture.enabled: true
-
- property bool followme: false
- property variant scaleLengths: [5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000]
-
- PositionSource{
- id: positionSource
- active: followme
-
- onPositionChanged: {
- map.center = positionSource.position.coordinate
- }
- }
-
- Slider {
- id: zoomSlider;
- minimum: map.minimumZoomLevel;
- maximum: map.maximumZoomLevel;
- opacity: 1
- visible: parent.visible
- z: map.z+1
- anchors {
- bottom: parent.bottom;
- bottomMargin: 15; rightMargin: 10; leftMargin: 90
- left: parent.left
- }
- width: parent.width - anchors.rightMargin - anchors.leftMargin
- value: map.zoomLevel
- onValueChanged: {
- map.zoomLevel = value
- }
- }
-
- signal coordinatesCaptured(double latitude, double longitude)
-
- Item {//scale
- id: scale
- parent: zoomSlider.parent
- visible: scaleText.text != "0 m"
- z: map.z
- opacity: 0.6
- anchors {
- bottom: zoomSlider.top;
- bottomMargin: 8;
- left: zoomSlider.left
- }
- Image {
- id: scaleImageLeft
- source: "../../resources/scale_end.png"
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- }
- Image {
- id: scaleImage
- source: "../../resources/scale.png"
- anchors.bottom: parent.bottom
- anchors.left: scaleImageLeft.right
- }
- Image {
- id: scaleImageRight
- source: "../../resources/scale_end.png"
- anchors.bottom: parent.bottom
- anchors.left: scaleImage.right
- }
- Text {
- id: scaleText
- color: "#004EAE"
- horizontalAlignment: Text.AlignHCenter
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.bottomMargin: 3
- text: "0 m"
- font.pixelSize: 14
- }
- Component.onCompleted: {
- map.calculateScale();
- }
- }
-
- Timer {
- id: scaleTimer
- interval: 100
- running: false
- repeat: false
- onTriggered: {
- map.calculateScale()
- }
- }
-
- onCenterChanged:{
- scaleTimer.restart()
- if (map.followme)
- if (map.center != positionSource.position.coordinate) map.followme = false
- }
-
- onZoomLevelChanged:{
- scaleTimer.restart()
- if (map.followme) map.center = positionSource.position.coordinate
- }
-
- onWidthChanged:{
- scaleTimer.restart()
- }
-
- onHeightChanged:{
- scaleTimer.restart()
- }
-
- Keys.onPressed: {
- if ((event.key == Qt.Key_Plus) || (event.key == Qt.Key_VolumeUp)) {
- map.zoomLevel += 1
- } else if ((event.key == Qt.Key_Minus) || (event.key == Qt.Key_VolumeDown)){
- map.zoomLevel -= 1
- }
- }
-
- function calculateScale(){
- var coord1, coord2, dist, text, f
- f = 0
- coord1 = map.toCoordinate(Qt.point(0,scale.y))
- coord2 = map.toCoordinate(Qt.point(0+scaleImage.sourceSize.width,scale.y))
- dist = Math.round(coord1.distanceTo(coord2))
-
- if (dist === 0) {
- // not visible
- } else {
- for (var i = 0; i < scaleLengths.length-1; i++) {
- if (dist < (scaleLengths[i] + scaleLengths[i+1]) / 2 ) {
- f = scaleLengths[i] / dist
- dist = scaleLengths[i]
- break;
- }
- }
- if (f === 0) {
- f = dist / scaleLengths[i]
- dist = scaleLengths[i]
- }
- }
-
- text = formatDistance(dist)
- scaleImage.width = (scaleImage.sourceSize.width * f) - 2 * scaleImageLeft.sourceSize.width
- scaleText.text = text
- }
-
- function roundNumber(number, digits) {
- var multiple = Math.pow(10, digits);
- return Math.round(number * multiple) / multiple;
- }
-
- function formatTime(sec){
- var value = sec
- var seconds = value % 60
- value /= 60
- value = (value > 1) ? Math.round(value) : 0
- var minutes = value % 60
- value /= 60
- value = (value > 1) ? Math.round(value) : 0
- var hours = value
- if (hours > 0) value = hours + "h:"+ minutes + "m"
- else value = minutes + "min"
- return value
- }
-
- function formatDistance(meters)
- {
- var dist = Math.round(meters)
- if (dist > 1000 ){
- if (dist > 100000){
- dist = Math.round(dist / 1000)
- }
- else{
- dist = Math.round(dist / 100)
- dist = dist / 10
- }
- dist = dist + " km"
- }
- else{
- dist = dist + " m"
- }
- return dist
- }
-}
diff --git a/examples/location/places/content/places/OptionsDialog.qml b/examples/location/places/content/places/OptionsDialog.qml
deleted file mode 100644
index c666a957..00000000
--- a/examples/location/places/content/places/OptionsDialog.qml
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-import QtLocation.examples 5.0
-
-Dialog {
- id: dialog
-
- property alias isFavoritesEnabled: enableFavoritesButton.selected
- property alias orderByDistance: orderByDistanceButton.selected
- property alias orderByName: orderByNameButton.selected
- property alias locales: localesInput.text
- property int listItemHeight: 21
-
- title: "Options"
-
- item: Column {
- id: options
- width: parent.width
- spacing: gap
-
- TextWithLabel {
- id: localesInput
-
- width: parent.width - gap
- height: listItemHeight
- label: "Locale(s)"
- enabled: true
- visible: placesPlugin.name != "" ? placesPlugin.supportsPlaces(Plugin.LocalizedPlacesFeature) : false;
- }
-
- Optionbutton {
- id: enableFavoritesButton
-
- function resetVisibility() {
- //jsondb plug-in is no more but saving of places may come back
- /*if (placesPlugin.name !== "places_jsondb") {
- var pluginNames = placesPlugin.availableServiceProviders;
- for (var i = 0; i < pluginNames.length; ++i) {
- if (pluginNames[i] === "places_jsondb") {
- enableFavoritesButton.visible = true;
- return;
- }
- }
- }*/
- enableFavoritesButton.visible = false;
- }
-
- width: parent.width
- text: "Enable favorites"
- toggle: true
- visible: false
-
- Component.onCompleted: {
- resetVisibility();
- placesPlugin.nameChanged.connect(resetVisibility);
- }
- }
-
- Optionbutton {
- id: orderByDistanceButton
- width: parent.width
- text: "Order by distance"
- toggle: true
- visible: true
- onClicked:
- if (selected)
- orderByNameButton.selected = false;
- }
- Optionbutton {
- id: orderByNameButton
- width: parent.width
- text: "Order by name"
- toggle: true
- visible: true
- onClicked:
- if (selected)
- orderByDistanceButton.selected = false;
- }
- }
-}
diff --git a/examples/location/places/content/places/PlaceDelegate.qml b/examples/location/places/content/places/PlaceDelegate.qml
deleted file mode 100644
index 3dba28a6..00000000
--- a/examples/location/places/content/places/PlaceDelegate.qml
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-import QtLocation.examples 5.0
-import "PlacesUtils.js" as PlacesUtils
-
-Item {
- id: placeDelegate
-
- property Place place
- property real distance
-
- signal searchForSimilar(variant place)
- signal showReviews(variant place)
- signal showEditorials(variant place)
- signal showImages(variant place)
-
- Flickable {
- anchors.fill: parent
-
- contentHeight: c.height
- contentWidth: width
-
- Column {
- id: c
-
- width: parent.width
- spacing: 2
- clip: true
-
- Row {
- width: parent.width
-
- Image {
- id: iconImage
- width: 40
- height: 40
- source: place ? (place.favorite ? place.favorite.icon.url(Qt.size(40,40))
- : place.icon.url(Qt.size(40,40)))
- : ""
- visible: source != ""
- }
-
- Text {
- id: placeName
- text: place ? (place.favorite ? place.favorite.name : place.name) : ""
- font.pixelSize: 16
- font.bold: true
- }
- }
-
- RatingView { rating: (place && place.ratings) ? place.ratings.average : 0 }
-
- Group { text: qsTr("Address") }
- Text { text: PlacesUtils.prettyDistance(distance) }
- Text {
- function placeAddress(place) {
- if (!place)
- return "";
-
- if (place.location.address.text.length > 0)
- return place.location.address.text;
-
- return place.location.address.street;
- }
-
- text: placeAddress(place)
- }
-
- Group {
- text: qsTr("Categories")
- visible: place && place.categories.length > 0
- }
- Text {
- function categoryNames(categories) {
- var result = "";
-
- for (var i = 0; i < categories.length; ++i) {
- if (result == "") {
- result = categories[i].name;
- } else {
- result = result + ", " + categories[i].name;
- }
- }
-
- return result;
- }
-
- text: place ? categoryNames(place.categories) : ""
- width: parent.width
- wrapMode: Text.WordWrap
- visible: place && place.categories.length > 0
- }
-
- Group {
- text: qsTr("Contact details")
- visible: phone.visible || fax.visible || email.visible || website.visible
- }
- Text {
- id: phone
- text: qsTr("Phone: ") + (place ? place.primaryPhone : "")
- visible: place && place.primaryPhone.length > 0
- }
- Text {
- id: fax
- text: qsTr("Fax: ") + (place ? place.primaryFax : "")
- visible: place && place.primaryFax.length > 0
- }
- Text {
- id: email
- text: place ? place.primaryEmail : ""
- visible: place && place.primaryEmail.length > 0
- }
- Text {
- id: website
- text: place ? '<a href=\"' + place.primaryWebsite + '\">' + place.primaryWebsite + '</a>' : ""
- visible: place && String(place.primaryWebsite).length > 0
- onLinkActivated: Qt.openUrlExternally(place.primaryWebsite)
- }
-
- Group {
- text: qsTr("Additional information")
- visible: extendedAttributes.count > 0 && extendedAttributes.height > 0
- }
-
- Repeater {
- id: extendedAttributes
- model: place ? place.extendedAttributes.keys() : null
- delegate: Text {
- text: place.extendedAttributes[modelData] ?
- place.extendedAttributes[modelData].label +
- place.extendedAttributes[modelData].text : ""
-
- visible: place.extendedAttributes[modelData] ? place.extendedAttributes[modelData].label.length > 0 : false
-
- width: c.width
- wrapMode: Text.WordWrap
- }
- }
-
- Column {
- id: buttons
-
- anchors.horizontalCenter: parent.horizontalCenter
-
- spacing: 5
-
- Button {
- text: qsTr("Editorials")
- enabled: place && place.editorialModel.totalCount > 0
- onClicked: showEditorials(place)
- }
- Button {
- text: qsTr("Reviews")
- enabled: place && place.reviewModel.totalCount > 0
- onClicked: showReviews(place)
- }
- Button {
- text: qsTr("Images")
- enabled: place && place.imageModel.totalCount > 0
- onClicked: showImages(place)
- }
- Button {
- text: qsTr("Find similar")
- onClicked: searchForSimilar(place)
- }
- }
- }
- }
-}
diff --git a/examples/location/places/content/places/PlaceEditorials.qml b/examples/location/places/content/places/PlaceEditorials.qml
deleted file mode 100644
index ee5ead1b..00000000
--- a/examples/location/places/content/places/PlaceEditorials.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-
-Item {
- anchors.fill: parent
-
- clip: true
-
- //! [PlaceEditorialModel view]
- ListView {
- anchors.fill: parent
-
- model: place.editorialModel
-
- delegate: EditorialDelegate { }
- }
- //! [PlaceEditorialModel view]
-}
diff --git a/examples/location/places/content/places/PlaceImages.qml b/examples/location/places/content/places/PlaceImages.qml
deleted file mode 100644
index e1afa5a6..00000000
--- a/examples/location/places/content/places/PlaceImages.qml
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-
-Item {
- id: root
-
- anchors.fill: parent
-
- clip: true
-
- GridView {
- id: gridView
-
- anchors.fill: parent
-
- model: place.imageModel
-
- cellWidth: width / 3
- cellHeight: cellWidth
-
- delegate: Rectangle {
- width: gridView.cellWidth
- height: gridView.cellHeight
-
- color: "#30FFFFFF"
-
- Image {
- anchors.fill: parent
- anchors.margins: 5
-
- source: url
-
- fillMode: Image.PreserveAspectFit
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- listView.positionViewAtIndex(index, ListView.Contain);
- root.state = "list";
- }
- }
- }
- }
-
- ListView {
- id: listView
-
- anchors.top: parent.top
- anchors.bottom: position.top
- width: parent.width
- spacing: 10
-
- model: place.imageModel
- orientation: ListView.Horizontal
- snapMode: ListView.SnapOneItem
-
- visible: false
-
- delegate: Item {
- width: listView.width
- height: listView.height
-
- Image {
- anchors.fill: parent
-
- source: url
-
- fillMode: Image.PreserveAspectFit
- }
-
- Text {
- text: supplier.name + "\n" + supplier.url
- width: parent.width
- anchors.bottom: parent.bottom
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: root.state = ""
- }
- }
-
- Text {
- id: position
-
- width: parent.width
- anchors.bottom: parent.bottom
- visible: listView.visible
-
- text: (listView.currentIndex + 1) + '/' + listView.model.totalCount
- horizontalAlignment: Text.AlignRight
- }
-
- states: [
- State {
- name: "list"
- PropertyChanges {
- target: gridView
- visible: false
- }
- PropertyChanges {
- target: listView
- visible: true
- }
- }
- ]
-}
diff --git a/examples/location/places/content/places/PlaceReviews.qml b/examples/location/places/content/places/PlaceReviews.qml
deleted file mode 100644
index 214fc98c..00000000
--- a/examples/location/places/content/places/PlaceReviews.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-
-Item {
- anchors.fill: parent
-
- clip: true
-
-//! [ReviewModel delegate]
- ListView {
- anchors.fill: parent
-
- model: place.reviewModel
-
- delegate: ReviewDelegate { }
- }
-//! [ReviewModel delegate]
-}
diff --git a/examples/location/places/content/places/PlacesUtils.js b/examples/location/places/content/places/PlacesUtils.js
deleted file mode 100644
index 756deb99..00000000
--- a/examples/location/places/content/places/PlacesUtils.js
+++ /dev/null
@@ -1,12 +0,0 @@
-.pragma library
-
-function prettyDistance(distance) {
- if (distance < 1000)
- return distance.toFixed(0) + "m";
-
- var km = distance/1000;
- if (km < 10)
- return km.toFixed(1) + "km";
-
- return km.toFixed(0) + "km";
-}
diff --git a/examples/location/places/content/places/RatingView.qml b/examples/location/places/content/places/RatingView.qml
deleted file mode 100644
index 8e6837b7..00000000
--- a/examples/location/places/content/places/RatingView.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** 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
-
-Row {
- property real rating: 0
- property int size: 32
-
- Repeater {
- model: Math.ceil(rating)
- Image {
- source: "../../resources/star.png"
- width: size
- height: size
- }
- }
-}
diff --git a/examples/location/places/content/places/ReviewDelegate.qml b/examples/location/places/content/places/ReviewDelegate.qml
deleted file mode 100644
index 9aba9269..00000000
--- a/examples/location/places/content/places/ReviewDelegate.qml
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-
-Item {
- id: root
-
- width: parent.width
- height: icon.height + 8
-
- Image {
- id: icon
-
- width: 64
- height: 64
-
- anchors.verticalCenter: root.verticalCenter
- anchors.left: root.left
- anchors.leftMargin: 4
-
- source: supplier.icon.url(Qt.size(64, 64), Icon.List)
- fillMode: Image.PreserveAspectFit
- }
-
- Text {
- anchors.top: icon.top
- anchors.topMargin: 4
- anchors.left: icon.right
- anchors.leftMargin: 4
- anchors.right: root.right
- anchors.rightMargin: 4
-
- text: model.title
- font.bold: true
- font.pixelSize: 16
-
- wrapMode: Text.WordWrap
- elide: Text.ElideRight
- maximumLineCount: 2
- }
-
- RatingView {
- anchors.bottom: icon.bottom
- anchors.bottomMargin: 4
- anchors.left: icon.right
- anchors.leftMargin: 4
- anchors.right: root.right
- anchors.rightMargin: 4
-
- rating: model.rating
- size: 16
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- placeContent.source = "";
- placeContent.data = model;
- placeContent.source = "ReviewPage.qml";
- }
- }
-}
diff --git a/examples/location/places/content/places/ReviewPage.qml b/examples/location/places/content/places/ReviewPage.qml
deleted file mode 100644
index 606ea2d4..00000000
--- a/examples/location/places/content/places/ReviewPage.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-
-Item {
- anchors.fill: parent
-
- property variant d: parent ? parent.data : null
-
- Flickable {
- anchors.fill: parent
-
- contentHeight: c.height
- contentWidth: width
-
- Column {
- id: c
-
- width: parent.width
- clip: true
-
- Text {
- text: d ? d.title : ""
- width: parent.width
- wrapMode: Text.WordWrap
- font.pixelSize: 24
- }
-
- Text {
- text: d ? Qt.formatDateTime(d.dateTime) : ""
- width: parent.width
- font.pixelSize: 18
- }
-
- RatingView {
- size: 16
- rating: d ? d.rating : 0.0
- }
-
- Text {
- text: d ? d.text : ""
- width: parent.width
- wrapMode: Text.WordWrap
- font.pixelSize: 20
- }
-
- Row {
- Image {
- width: 16
- height: 16
-
- source: d ? d.supplier.icon.url(Qt.size(width, height), Icon.List) : ""
- }
- Text {
- text: d ? d.supplier.name : ""
- font.pixelSize: 16
- }
- }
- Text {
- text: d ? d.supplier.url : ""
- font.pixelSize: 16
- }
- }
- }
-}
diff --git a/examples/location/places/content/places/SearchBox.qml b/examples/location/places/content/places/SearchBox.qml
deleted file mode 100644
index c61ba069..00000000
--- a/examples/location/places/content/places/SearchBox.qml
+++ /dev/null
@@ -1,244 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-import QtLocation.examples 5.0
-
-Rectangle {
- id: searchRectangle
-
- property bool suggestionsEnabled: true
- property int expandedHeight: childrenRect.height
- readonly property int baseHeight: searchBox.height + 20
-
- color: "#ECECEC"
-
- height: baseHeight
- Behavior on height {
- NumberAnimation { duration: 250 }
- }
-
- clip: true
-
- TextWithLabel {
- id: searchBox
- label: "Search"
- text: "sushi"
-
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.right: row.left
- anchors.rightMargin: 10
- anchors.top: parent.top
- anchors.topMargin: 10
-
- busy: placeSearchModel.status === PlaceSearchModel.Loading
-
- //! [PlaceSearchSuggestionModel search text changed]
- onTextChanged: {
- if (searchRectangle.suggestionsEnabled) {
- if (text.length >= 3) {
- if (suggestionModel != null) {
- suggestionModel.searchTerm = text;
- suggestionModel.update();
- }
- } else {
- searchRectangle.state = "";
- }
- }
- }
- //! [PlaceSearchSuggestionModel search text changed]
- }
-
- Row {
- id: row
-
- anchors.right: parent.right
- anchors.rightMargin: 10
- anchors.top: parent.top
- anchors.topMargin: 10
- spacing: 10
-
- IconButton {
- id: searchButton
-
- anchors.verticalCenter: parent.verticalCenter
-
- source: "../../resources/search.png"
- pressedSource: "../../resources/search_pressed.png"
-
- onClicked: {
- placeSearchModel.searchForText(searchBox.text);
- searchRectangle.state = "";
- }
- }
-
- IconButton {
- id: categoryButton
-
- source: "../../resources/categories.png"
- pressedSource: "../../resources/categories_pressed.png"
-
- onClicked: {
- if (searchRectangle.state !== "CategoriesShown")
- searchRectangle.state = "CategoriesShown";
- else if (suggestionView.count > 0)
- searchRectangle.state = "SuggestionsShown";
- else
- searchRectangle.state = "";
- }
- }
- }
-
- CategoryView {
- id: categoryView
-
- anchors.top: row.bottom
- height: expandedHeight - y
- visible: false
- spacing: 5
-
- onCategoryClicked: {
- placeSearchModel.searchForCategory(category);
- searchRectangle.state = "";
- }
- }
-
- BusyIndicator {
- id: busy
-
- visible: false
-
- anchors.centerIn: parent
- }
-
- Text {
- id: noCategories
-
- anchors.centerIn: parent
- text: qsTr("No categories")
- visible: false
- }
-
- //! [PlaceSearchSuggestionModel view 1]
- ListView {
- id: suggestionView
- //! [PlaceSearchSuggestionModel view 1]
-
- anchors.top: row.bottom
- anchors.topMargin: 10
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.right: parent.right
- anchors.rightMargin: 10
- height: 450
- visible: false
-
- clip: true
- snapMode: ListView.SnapToItem
-
- //! [PlaceSearchSuggestionModel view 2]
- model: suggestionModel
- delegate: Text {
- text: suggestion
-
- width: parent.width
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- suggestionsEnabled = false;
- searchBox.text = suggestion;
- suggestionsEnabled = true;
- placeSearchModel.searchForText(suggestion);
- searchRectangle.state = "";
- }
- }
- }
- }
- //! [PlaceSearchSuggestionModel view 2]
-
- //! [PlaceSearchSuggestionModel model]
- PlaceSearchSuggestionModel {
- id: suggestionModel
- plugin: placesPlugin
- searchArea: placeSearchModel.searchArea
-
- onStatusChanged: {
- if (status == PlaceSearchSuggestionModel.Ready)
- searchRectangle.state = "SuggestionsShown";
- }
- }
- //! [PlaceSearchSuggestionModel model]
-
- states: [
- State {
- name: "CategoriesShown"
- PropertyChanges {
- target: searchRectangle
- height: expandedHeight
- }
- PropertyChanges {
- target: busy
- visible: categoryModel.status === CategoryModel.Loading
- }
- PropertyChanges {
- target: noCategories
- visible: categoryView.count == 0 && !busy.visible
- }
- PropertyChanges {
- target: categoryView
- visible: true && !busy.visible
- }
- },
- State {
- name: "SuggestionsShown"
- PropertyChanges {
- target: searchRectangle
- height: childrenRect.height + 20
- }
- PropertyChanges {
- target: suggestionView
- visible: true
- }
- }
- ]
-}
diff --git a/examples/location/places/content/places/SearchResultDelegate.qml b/examples/location/places/content/places/SearchResultDelegate.qml
deleted file mode 100644
index dea9043a..00000000
--- a/examples/location/places/content/places/SearchResultDelegate.qml
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-import "PlacesUtils.js" as PlacesUtils
-
-Item {
- id: root
-
- signal displayPlaceDetails(variant data)
- signal searchFor(string query)
-
- width: parent.width
- height: childrenRect.height + 20
-
- //! [PlaceSearchModel place delegate]
- Component {
- id: placeComponent
-
- Item {
- id: placeRoot
-
- height: childrenRect.height
- width: parent.width
-
- Rectangle {
- anchors.fill: parent
- color: "#dbffde"
- visible: model.sponsored !== undefined ? model.sponsored : false
-
- Text {
- text: qsTr("Sponsored result")
- horizontalAlignment: Text.AlignRight
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- font.pixelSize: 8
- visible: model.sponsored !== undefined ? model.sponsored : false
- }
- }
-
- Row {
- Image {
- source: place.favorite ? "../../resources/star.png" : place.icon.url()
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- Text {
- id: placeName
- text: place.favorite ? place.favorite.name : place.name
- }
-
- Text {
- id: distanceText
- font.italic: true
- text: PlacesUtils.prettyDistance(distance)
- }
- }
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: placeRoot.state = "Pressed"
- onReleased: placeRoot.state = ""
- onCanceled: placeRoot.state = ""
-
- onClicked: {
- if (model.type === undefined || type === PlaceSearchModel.PlaceResult) {
- if (!place.detailsFetched)
- place.getDetails();
-
- root.displayPlaceDetails({
- distance: model.distance,
- place: model.place,
- });
- }
- }
- }
-
- states: [
- State {
- name: ""
- },
- State {
- name: "Pressed"
- PropertyChanges { target: placeName; color: "#1C94FC"}
- PropertyChanges { target: distanceText; color: "#1C94FC"}
- }
- ]
- }
- }
- //! [PlaceSearchModel place delegate]
-
- Component {
- id: proposedSearchComponent
-
- Item {
- id: proposedSearchRoot
-
- height: childrenRect.height
- width: parent.width
-
- Row {
- Image {
- source: icon.url()
- }
-
- Text {
- id: proposedSearchTitle
- anchors.verticalCenter: parent.verticalCenter
- text: "Search for " + title
- }
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: proposedSearchRoot.state = "Pressed"
- onReleased: proposedSearchRoot.state = ""
- onCanceled: proposedSearchRoot.state = ""
-
- onClicked: root.ListView.view.model.updateWith(index);
- }
-
- states: [
- State {
- name: ""
- },
- State {
- name: "Pressed"
- PropertyChanges { target: proposedSearchTitle; color: "#1C94FC"}
- }
- ]
- }
- }
-
- Loader {
- anchors.left: parent.left
- anchors.right: parent.right
-
- sourceComponent: {
- switch (model.type) {
- case PlaceSearchModel.PlaceResult:
- return placeComponent;
- case PlaceSearchModel.ProposedSearchResult:
- return proposedSearchComponent;
- default:
- //do nothing, don't assign component if result type not recognized
- }
- }
- }
-}
diff --git a/examples/location/places/content/places/SearchResultView.qml b/examples/location/places/content/places/SearchResultView.qml
deleted file mode 100644
index 06b0e1b8..00000000
--- a/examples/location/places/content/places/SearchResultView.qml
+++ /dev/null
@@ -1,239 +0,0 @@
-/****************************************************************************
-**
-** 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
-import QtLocation 5.3
-import QtLocation.examples 5.0
-
-Item {
- id: root
-
- clip: true
-
- function showSearchResults() {
- view.currentIndex = 0;
- placeContentList.source = "";
- placeContentList.place = null;
- }
-
- function showPlaceDetails(data) {
- placeDetails.place = data.place;
- placeDetails.distance = data.distance;
- view.currentIndex = 1;
- }
-
- ListView {
- id: view
-
- orientation: ListView.Horizontal
- interactive: false
- anchors.fill: parent
- snapMode: ListView.SnapOneItem
-
- model: VisualItemModel {
- Item {
- // search results (page 0)
-
- width: root.width
- height: root.height
-
- Connections {
- target: placeSearchModel
- onStatusChanged: searchView.visible = true
- }
-
- //! [PlaceSearchModel place list]
- ListView {
- id: searchView
-
- anchors.fill: parent
-
- model: placeSearchModel
- delegate: SearchResultDelegate {
- onDisplayPlaceDetails: showPlaceDetails(data)
- onSearchFor: placeSearchModel.searchForText(query);
- }
-
- footer: Item {
- width: searchView.width
- height: childrenRect.height
-
- Button {
- text: qsTr("Previous")
- enabled: placeSearchModel.previousPagesAvailable
- onClicked: placeSearchModel.previousPage()
-
- anchors.left: parent.left
- }
-
- Button {
- text: qsTr("Clear")
- onClicked: placeSearchModel.reset()
-
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Button {
- text: qsTr("Next")
- enabled: placeSearchModel.nextPagesAvailable
- onClicked: placeSearchModel.nextPage()
-
- anchors.right: parent.right
- }
- }
- }
- //! [PlaceSearchModel place list]
- }
- Item {
- // place details (page 1)
- width: root.width
- height: root.height
-
- IconButton {
- id: placeBackButton
- anchors.left: parent.left
-
- source: "../../resources/left.png"
- pressedSource: "../../resources/left_pressed.png"
-
- onClicked: showSearchResults()
- }
-
- PlaceDelegate {
- id: placeDetails
-
- anchors.top: placeBackButton.bottom
- anchors.bottom: parent.bottom
- width: parent.width
- anchors.margins: 10
-
- onShowEditorials: {
- placeContentList.source = "";
- placeContentList.place = place;
- placeContentList.source = "PlaceEditorials.qml";
- view.currentIndex = 2;
- }
-
- onShowReviews: {
- placeContentList.source = "";
- placeContentList.place = place;
- placeContentList.source = "PlaceReviews.qml";
- view.currentIndex = 2;
- }
-
- onShowImages: {
- placeContentList.source = "";
- placeContentList.place = place;
- placeContentList.source = "PlaceImages.qml";
- view.currentIndex = 2;
- }
-
- //! [PlaceRecommendationModel search]
- onSearchForSimilar: {
- placeContentList.source = "";
- placeSearchModel.searchForRecommendations(place.placeId);
- }
- //! [PlaceRecommendationModel search]
- }
- }
- Item {
- // content list (page 2)
- width: root.width
- height: root.height
-
- IconButton {
- id: contentListBackButton
-
- source: "../../resources/left.png"
- pressedSource: "../../resources/left_pressed.png"
-
- onClicked: view.currentIndex = 1
- }
-
- Loader {
- id: placeContentList
-
- property Place place
-
- anchors.top: contentListBackButton.bottom
- anchors.bottom: parent.bottom
- width: parent.width
- anchors.margins: 10
-
- onStatusChanged: {
- if (status === Loader.Null)
- place = null;
- }
- }
- }
- Item {
- // content (page 3)
- width: root.width
- height: root.height
-
- IconButton {
- id: contentBackButton
-
- source: "../../resources/left.png"
- pressedSource: "../../resources/left_pressed.png"
-
- onClicked: {
- view.currentIndex = 2;
- placeContent.source = "";
- placeContent.data = null;
- }
- }
-
- Loader {
- id: placeContent
-
- anchors.top: contentBackButton.bottom
- anchors.bottom: parent.bottom
- width: parent.width
- anchors.margins: 10
-
- onLoaded: view.currentIndex = 3
-
- property variant data
- }
- }
- }
- }
-}