summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/location/common/common.pri37
-rw-r--r--examples/location/common/common.qrc59
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/Button.qml107
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/IconButton.qml81
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/Menu.qml166
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/Slider.qml124
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/TextWithLabel.qml96
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/style/ButtonStyle.qml49
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml49
-rw-r--r--examples/location/common/imports/QtLocation/examples/components/style/VMenuItemStyle.qml44
-rw-r--r--examples/location/common/imports/QtLocation/examples/dialogs/Dialog.qml156
-rw-r--r--examples/location/common/imports/QtLocation/examples/qmldir13
-rwxr-xr-xexamples/location/common/resources/busy.pngbin2921 -> 0 bytes
-rw-r--r--examples/location/common/resources/button.pngbin666 -> 0 bytes
-rw-r--r--examples/location/common/resources/button_pressed.pngbin563 -> 0 bytes
-rw-r--r--examples/location/common/resources/catch.pngbin530 -> 0 bytes
-rw-r--r--examples/location/common/resources/categories_pressed.pngbin255 -> 0 bytes
-rw-r--r--examples/location/common/resources/checkbox.pngbin410 -> 0 bytes
-rw-r--r--examples/location/common/resources/checkbox_selected.pngbin755 -> 0 bytes
-rw-r--r--examples/location/common/resources/cross.pngbin1514 -> 0 bytes
-rw-r--r--examples/location/common/resources/cross_hovered.pngbin1579 -> 0 bytes
-rw-r--r--examples/location/common/resources/cross_pressed.pngbin1556 -> 0 bytes
-rw-r--r--examples/location/common/resources/hmenuItem.pngbin244 -> 0 bytes
-rw-r--r--examples/location/common/resources/hmenuItem_pressed.pngbin600 -> 0 bytes
-rw-r--r--examples/location/common/resources/left_pressed.pngbin2860 -> 0 bytes
-rw-r--r--examples/location/common/resources/marker.pngbin2341 -> 0 bytes
-rw-r--r--examples/location/common/resources/marker_hovered.pngbin2358 -> 0 bytes
-rw-r--r--examples/location/common/resources/marker_selected.pngbin2355 -> 0 bytes
-rw-r--r--examples/location/common/resources/node.pngbin432 -> 0 bytes
-rw-r--r--examples/location/common/resources/node_selected.pngbin458 -> 0 bytes
-rw-r--r--examples/location/common/resources/option_button.pngbin777 -> 0 bytes
-rw-r--r--examples/location/common/resources/option_button_selected.pngbin654 -> 0 bytes
-rw-r--r--examples/location/common/resources/pencil.pngbin1276 -> 0 bytes
-rw-r--r--examples/location/common/resources/pencil_hovered.pngbin1201 -> 0 bytes
-rw-r--r--examples/location/common/resources/pencil_pressed.pngbin1159 -> 0 bytes
-rw-r--r--examples/location/common/resources/quit.pngbin2439 -> 0 bytes
-rw-r--r--examples/location/common/resources/quit_hovered.pngbin2702 -> 0 bytes
-rw-r--r--examples/location/common/resources/quit_pressed.pngbin2396 -> 0 bytes
-rw-r--r--examples/location/common/resources/right_pressed.pngbin2849 -> 0 bytes
-rw-r--r--examples/location/common/resources/search_pressed.pngbin490 -> 0 bytes
-rw-r--r--examples/location/common/resources/titlebar.pngbin889 -> 0 bytes
-rw-r--r--examples/location/common/resources/titlebar.sci5
-rw-r--r--examples/location/common/resources/vmenuItem.pngbin224 -> 0 bytes
-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/PlacesUtils.js12
-rw-r--r--examples/location/places/content/places/SearchBox.qml244
-rw-r--r--examples/location/places/content/places/SearchResultView.qml239
-rw-r--r--examples/location/places/forms/Message.qml (renamed from examples/location/places/content/places/PlaceEditorials.qml)24
-rw-r--r--examples/location/places/forms/MessageForm.ui.qml (renamed from examples/location/places/content/places/EditorialPage.qml)87
-rw-r--r--examples/location/places/forms/PlaceDetails.qml127
-rw-r--r--examples/location/places/forms/PlaceDetailsForm.ui.qml285
-rw-r--r--examples/location/places/forms/SearchBoundingBox.qml (renamed from examples/location/common/imports/QtLocation/examples/components/Optionbutton.qml)59
-rw-r--r--examples/location/places/forms/SearchBoundingBoxForm.ui.qml163
-rw-r--r--examples/location/places/forms/SearchBoundingCircle.qml69
-rw-r--r--examples/location/places/forms/SearchBoundingCircleForm.ui.qml151
-rw-r--r--examples/location/places/forms/SearchCenter.qml (renamed from examples/location/common/imports/QtLocation/examples/components/Checkbox.qml)47
-rw-r--r--examples/location/places/forms/SearchCenterForm.ui.qml140
-rw-r--r--examples/location/places/forms/SearchOptions.qml (renamed from examples/location/places/content/places/CategoryView.qml)65
-rw-r--r--examples/location/places/forms/SearchOptionsForm.ui.qml159
-rw-r--r--examples/location/places/helper.js (renamed from examples/location/common/imports/QtLocation/examples/dialogs/ErrorDialog.qml)23
-rw-r--r--examples/location/places/icon.pngbin5312 -> 0 bytes
-rw-r--r--examples/location/places/items/MainMenu.qml (renamed from examples/location/common/imports/QtLocation/examples/components/TitleBar.qml)76
-rw-r--r--examples/location/places/items/MapComponent.qml (renamed from examples/location/places/content/places/MapComponent.qml)261
-rw-r--r--examples/location/places/items/SearchBar.qml122
-rw-r--r--examples/location/places/main.cpp (renamed from examples/location/places/qmlplaceswrapper.cpp)22
-rw-r--r--examples/location/places/places.pro68
-rw-r--r--examples/location/places/places.qml786
-rw-r--r--examples/location/places/places.qrc42
-rw-r--r--examples/location/places/placeswrapper.qrc23
-rw-r--r--examples/location/places/resources/categories.png (renamed from examples/location/common/resources/categories.png)bin255 -> 255 bytes
-rw-r--r--examples/location/places/resources/left.png (renamed from examples/location/common/resources/left.png)bin290 -> 290 bytes
-rw-r--r--examples/location/places/resources/marker.pngbin0 -> 1051 bytes
-rw-r--r--examples/location/places/resources/right.png (renamed from examples/location/common/resources/right.png)bin302 -> 302 bytes
-rw-r--r--examples/location/places/resources/scale.png (renamed from examples/location/common/resources/scale.png)bin176 -> 176 bytes
-rw-r--r--examples/location/places/resources/scale_end.png (renamed from examples/location/common/resources/scale_end.png)bin208 -> 208 bytes
-rw-r--r--examples/location/places/resources/search.png (renamed from examples/location/common/resources/search.png)bin442 -> 442 bytes
-rw-r--r--examples/location/places/resources/star.png (renamed from examples/location/common/resources/star.png)bin4204 -> 4204 bytes
-rw-r--r--examples/location/places/views/CategoryDelegate.qml (renamed from examples/location/places/content/places/CategoryDelegate.qml)91
-rw-r--r--examples/location/places/views/CategoryView.qml (renamed from examples/location/common/imports/QtLocation/examples/components/Fader.qml)47
-rw-r--r--examples/location/places/views/EditorialDelegate.qml (renamed from examples/location/places/content/places/EditorialDelegate.qml)17
-rw-r--r--examples/location/places/views/EditorialPage.qml114
-rw-r--r--examples/location/places/views/EditorialView.qml (renamed from examples/location/common/imports/QtLocation/examples/components/BusyIndicator.qml)26
-rw-r--r--examples/location/places/views/ImageView.qml (renamed from examples/location/places/content/places/PlaceImages.qml)36
-rw-r--r--examples/location/places/views/RatingView.qml (renamed from examples/location/places/content/places/RatingView.qml)4
-rw-r--r--examples/location/places/views/ReviewDelegate.qml (renamed from examples/location/places/content/places/ReviewDelegate.qml)17
-rw-r--r--examples/location/places/views/ReviewPage.qml (renamed from examples/location/places/content/places/ReviewPage.qml)91
-rw-r--r--examples/location/places/views/ReviewView.qml (renamed from examples/location/places/content/places/PlaceReviews.qml)27
-rw-r--r--examples/location/places/views/SearchResultDelegate.qml (renamed from examples/location/places/content/places/SearchResultDelegate.qml)127
-rw-r--r--examples/location/places/views/SearchResultView.qml (renamed from examples/location/common/imports/QtLocation/examples/dialogs/InputDialog.qml)77
-rw-r--r--examples/location/places/views/SuggestionView.qml (renamed from examples/location/places/content/places/Group.qml)46
91 files changed, 2400 insertions, 2929 deletions
diff --git a/examples/location/common/common.pri b/examples/location/common/common.pri
deleted file mode 100644
index 30ede711..00000000
--- a/examples/location/common/common.pri
+++ /dev/null
@@ -1,37 +0,0 @@
-
-QML_IMPORT_PATH += $$PWD/imports
-
-RESOURCES += \
- $$PWD/common.qrc
-
-commonresources.files += $$PWD/resources/*
-
-qmlcomponents.files += \
- $$PWD/imports/QtLocation/examples/components/TextWithLabel.qml \
- $$PWD/imports/QtLocation/examples/components/Button.qml \
- $$PWD/imports/QtLocation/examples/components/Checkbox.qml \
- $$PWD/imports/QtLocation/examples/components/Fader.qml \
- $$PWD/imports/QtLocation/examples/components/Optionbutton.qml \
- $$PWD/imports/QtLocation/examples/components/Slider.qml \
- $$PWD/imports/QtLocation/examples/components/TitleBar.qml \
- $$PWD/imports/QtLocation/examples/components/ButtonRow.qml \
- $$PWD/imports/QtLocation/examples/components/Menu.qml \
- $$PWD/imports/QtLocation/examples/components/IconButton.qml \
- $$PWD/imports/QtLocation/examples/components/BusyIndicator.qml
-OTHER_FILES += $$qmlcomponents.files
-
-qmlcomponentsstyle.files += \
- $$PWD/imports/QtLocation/examples/components/style/Style.qml \
- $$PWD/imports/QtLocation/examples/components/style/ButtonStyle.qml \
- $$PWD/imports/QtLocation/examples/components/style/HMenuItemStyle.qml \
- $$PWD/imports/QtLocation/examples/components/style/VMenuItemStyle.qml
-OTHER_FILES += $$qmlcomponentsstyle.files
-
-qmldialogs.files += \
- $$PWD/imports/QtLocation/examples/dialogs/Dialog.qml \
- $$PWD/imports/QtLocation/examples/dialogs/InputDialog.qml \
- $$PWD/imports/QtLocation/examples/dialogs/ErrorDialog.qml
-OTHER_FILES += $$qmldialogs.files
-
-qmldir.files += $$PWD/imports/QtLocation/examples/qmldir
-OTHER_FILES += $$qmldir.files
diff --git a/examples/location/common/common.qrc b/examples/location/common/common.qrc
deleted file mode 100644
index bfd79b73..00000000
--- a/examples/location/common/common.qrc
+++ /dev/null
@@ -1,59 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>imports/QtLocation/examples/qmldir</file>
- <file>imports/QtLocation/examples/components/style/ButtonStyle.qml</file>
- <file>imports/QtLocation/examples/components/style/HMenuItemStyle.qml</file>
- <file>imports/QtLocation/examples/components/style/VMenuItemStyle.qml</file>
- <file>imports/QtLocation/examples/components/BusyIndicator.qml</file>
- <file>imports/QtLocation/examples/components/Button.qml</file>
- <file>imports/QtLocation/examples/components/Checkbox.qml</file>
- <file>imports/QtLocation/examples/components/Fader.qml</file>
- <file>imports/QtLocation/examples/components/IconButton.qml</file>
- <file>imports/QtLocation/examples/components/Menu.qml</file>
- <file>imports/QtLocation/examples/components/Optionbutton.qml</file>
- <file>imports/QtLocation/examples/components/Slider.qml</file>
- <file>imports/QtLocation/examples/components/TextWithLabel.qml</file>
- <file>imports/QtLocation/examples/components/TitleBar.qml</file>
- <file>imports/QtLocation/examples/dialogs/Dialog.qml</file>
- <file>imports/QtLocation/examples/dialogs/InputDialog.qml</file>
- <file>imports/QtLocation/examples/dialogs/ErrorDialog.qml</file>
- <file>resources/busy.png</file>
- <file>resources/button_pressed.png</file>
- <file>resources/button.png</file>
- <file>resources/catch.png</file>
- <file>resources/categories_pressed.png</file>
- <file>resources/categories.png</file>
- <file>resources/checkbox_selected.png</file>
- <file>resources/checkbox.png</file>
- <file>resources/cross_hovered.png</file>
- <file>resources/cross_pressed.png</file>
- <file>resources/cross.png</file>
- <file>resources/hmenuItem_pressed.png</file>
- <file>resources/hmenuItem.png</file>
- <file>resources/left_pressed.png</file>
- <file>resources/left.png</file>
- <file>resources/marker_hovered.png</file>
- <file>resources/marker_selected.png</file>
- <file>resources/marker.png</file>
- <file>resources/node_selected.png</file>
- <file>resources/node.png</file>
- <file>resources/option_button_selected.png</file>
- <file>resources/option_button.png</file>
- <file>resources/pencil_hovered.png</file>
- <file>resources/pencil_pressed.png</file>
- <file>resources/pencil.png</file>
- <file>resources/quit_hovered.png</file>
- <file>resources/quit_pressed.png</file>
- <file>resources/quit.png</file>
- <file>resources/right_pressed.png</file>
- <file>resources/right.png</file>
- <file>resources/scale_end.png</file>
- <file>resources/scale.png</file>
- <file>resources/search_pressed.png</file>
- <file>resources/search.png</file>
- <file>resources/star.png</file>
- <file>resources/titlebar.png</file>
- <file>resources/titlebar.sci</file>
- <file>resources/vmenuItem.png</file>
- </qresource>
-</RCC>
diff --git a/examples/location/common/imports/QtLocation/examples/components/Button.qml b/examples/location/common/imports/QtLocation/examples/components/Button.qml
deleted file mode 100644
index b34f66fe..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/Button.qml
+++ /dev/null
@@ -1,107 +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 "style"
-
-Item {
- id: container
-
- signal clicked
-
- property alias text: buttonText.text
- property alias color: buttonText.color
- property alias paintedWidth: buttonText.paintedWidth
- property alias paintedHeight: buttonText.paintedHeight
- property bool checked: false
- property bool enabled: true
- property ButtonStyle style: ButtonStyle{}
-
- width: buttonText.width * 1.2
- height: buttonText.height * 1.2
-
- function disable() {
- enabled = false;
- }
-
- function enable() {
- enabled = true;
- }
-
- BorderImage {
- id: buttonImage
- source: container.style.background
- anchors.fill: parent
- }
-
- MouseArea {
- id: mouseRegion
- anchors.fill: buttonImage
- hoverEnabled: false
- onClicked: { container.clicked() }
- }
- Text {
- id: buttonText
- color: checked ? container.style.fontcolor_selected : container.style.fontcolor_normal
- anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 14
- style: Text.Normal
- anchors.baseline: parent.bottom
- anchors.baselineOffset: -6
- }
-
- states: [
- State {
- name: "Pressed"
- when: mouseRegion.pressed == true
- PropertyChanges { target: buttonImage; source: container.style.pressedBackground }
- },
- State {
- name: "Hovered"
- when: mouseRegion.containsMouse
- PropertyChanges{ target: buttonImage; source: container.style.disabledBackground }
- },
- State {
- name: "Disabled"
- when: !enabled
- PropertyChanges{ target: buttonText; color: "dimgray" }
- PropertyChanges{ target: mouseRegion; enabled: false }
- }
- ]
-}
diff --git a/examples/location/common/imports/QtLocation/examples/components/IconButton.qml b/examples/location/common/imports/QtLocation/examples/components/IconButton.qml
deleted file mode 100644
index 91cb17c6..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/IconButton.qml
+++ /dev/null
@@ -1,81 +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: root
-
- property url source
- property url hoveredSource: source
- property url pressedSource: source
-
- signal clicked
-
- width: childrenRect.width
- height: childrenRect.height
-
- Image {
- id: image
-
- source: parent.source
- height: sourceSize.height
-
- MouseArea {
- id: mouseRegion
- hoverEnabled: false
- anchors.fill: parent
- onClicked: root.clicked()
- }
-
- states: [
- State {
- name: "Pressed"
- when: mouseRegion.pressed
- PropertyChanges { target: image; source: pressedSource }
- },
- State {
- name: "Hover"
- when: mouseRegion.containsMouse
- PropertyChanges { target: image; source: hoveredSource }
- }
- ]
- }
-}
diff --git a/examples/location/common/imports/QtLocation/examples/components/Menu.qml b/examples/location/common/imports/QtLocation/examples/components/Menu.qml
deleted file mode 100644
index 9691dd33..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/Menu.qml
+++ /dev/null
@@ -1,166 +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
-
-Grid {
- id: menu
- enabled: opacity > 0 ? true : false
-
- property bool horizontalOrientation: true
- property list <Button> buttons
- width: parent.width
- height: horizontalOrientation ? 40 : ((children.length > 0) ? children[0].height * children.length : 0)
- spacing: 0
- property string exclusiveButton: ""
- property bool exclusive: false
- property bool autoWidth: false
- opacity: 1
- rows: (horizontalOrientation) ? 1 : children.length
- columns: (horizontalOrientation) ? children.length : 1
- signal clicked(string button)
-
- onChildrenChanged: {
- resizeItems()
- }
-
- onExclusiveChanged: {
- if (exclusive){
- if (children.length > 0) exclusiveButton = children[0].text
- }
- else
- exclusiveButton = ""
- }
-
- onExclusiveButtonChanged:{
- if (exclusive) {
- for (var i = 0; i<children.length; i++){
- if (children[i].text == exclusiveButton){
- children[i].checked = true
- break
- }
- }
- }
- }
-
- function addItem(caption) {
- var button, myArray
- if (horizontalOrientation)
- button = Qt.createQmlObject ('import "style"; Button {height: menu.height; onClicked: {menu.itemClicked(text)} style: HMenuItemStyle {}}', menu)
- else
- button = Qt.createQmlObject ('import "style"; Button {height: 35; width: menu.width; onClicked: {menu.itemClicked(text)} style: VMenuItemStyle {}}', menu)
- button.text = caption
-
- myArray = new Array()
- for (var i = 0; i<children.length; i++){
- myArray.push(children[i])
- }
- myArray.push(button)
- children = myArray
-
- return button
- }
-
- function deleteItem(caption){
- var myArray
-
- myArray = new Array()
- for (var i = 0; i<children.length; i++){
- if (children[i].text != caption)
- myArray.push(children[i])
- }
- children = myArray
- }
-
- function clear() {
- children = []
- exclusiveButton = ""
- }
-
- function disableItem(caption){
- for (var i = 0; i<children.length; i++){
- if (children[i].text == caption){
- children[i].disable()
- break
- }
- }
- }
-
- function enableItem(caption){
- for (var i = 0; i<children.length; i++){
- if (children[i].text == caption){
- children[i].enable()
- break
- }
- }
- }
-
- function resizeItems(){
- if (horizontalOrientation) {
- for (var i = 0; i<children.length; i++)
- children[i].width = parent.width/children.length - spacing
- } else if (autoWidth) {
- if (children.length > 0) {
- var maxWidth = children[0].paintedWidth
- for (var i = 1; i<children.length; i++){
- if (children[i].paintedWidth > maxWidth) {
- maxWidth = children[i].paintedWidth
- }
- }
- menu.width = maxWidth + 20
- }
- for (var i = 0; i < children.length; i++)
- children[i].width = menu.width;
- }
- }
-
- function itemClicked(text){
- if (exclusive && text != exclusiveButton) {
- for (var i = 0; i<children.length; i++){
- if (children[i].text == exclusiveButton){
- children[i].checked = false
- break
- }
- }
- exclusiveButton = text
- }
- clicked(text)
- }
-}
diff --git a/examples/location/common/imports/QtLocation/examples/components/Slider.qml b/examples/location/common/imports/QtLocation/examples/components/Slider.qml
deleted file mode 100644
index ee6957bd..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/Slider.qml
+++ /dev/null
@@ -1,124 +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: slider;
- height: 10
- property real value // value is read/write.
- property real minimum: 0
- property real maximum: 1
- property int length: width - handle.width
-
- Rectangle {
- anchors.fill: parent
- border.width: 1;
- border.color: "lightgrey"
- radius: 8
- color: "white"
- opacity: 1
- }
-
- Rectangle {
- anchors.left: parent.left
- anchors.leftMargin: 4
- anchors.top: parent.top
- anchors.topMargin: (parent.height - height)/2
- height: 3
- width: handle.x - x
- color: "#1c94fc"
- }
-
-
- Rectangle {
- id: labelRect
- width: label.width
- height: label.height + 4
- radius: 4
- smooth: true
- color: "white"
- border.color: "lightgrey"
- anchors.bottom: handle.top
- anchors.bottomMargin: 4
- x: Math.max(Math.min(handle.x + (handle.width - width )/2, slider.width - width),0)
- visible: mouseRegion.pressed
- Text{
- id: label
- color: "darkgrey"
- text: slider.value.toFixed(2)
- width: font.pointSize * 3.5
- anchors.horizontalCenter: labelRect.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- anchors.baseline: parent.bottom
- anchors.baselineOffset: -6
- font.pixelSize: 14
- }
- }
-
- Rectangle {
- id: handle;
- smooth: true
- width: 26;
- y: (slider.height - height)/2;
- x: (slider.value - slider.minimum) * slider.length / (slider.maximum - slider.minimum)
-
- height: width; radius: width/2
- gradient: normalGradient
- border.width: 2
- border.color: "white"
-
- Gradient {
- id: normalGradient
- GradientStop { position: 0.0; color: "#b0b0b0" }
- GradientStop { position: 0.66; color: "#909090" }
- GradientStop { position: 1.0; color: "#545454" }
- }
-
- MouseArea {
- id: mouseRegion
- hoverEnabled: false
- anchors.fill: parent; drag.target: parent
- drag.axis: Drag.XAxis; drag.minimumX: 0; drag.maximumX: slider.length
- preventStealing: true
- onPositionChanged: { slider.value = (slider.maximum - slider.minimum) * handle.x / slider.length + slider.minimum; }
- }
- }
-}
diff --git a/examples/location/common/imports/QtLocation/examples/components/TextWithLabel.qml b/examples/location/common/imports/QtLocation/examples/components/TextWithLabel.qml
deleted file mode 100644
index 3e3b044e..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/TextWithLabel.qml
+++ /dev/null
@@ -1,96 +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 {
- id: textWithLabel
- height: inputRectangle.height
-
- property alias label: label.text
- property alias text: inputField.text
- property alias labelWidth: label.width
- property alias font: inputField.font
- property alias busy: busyIndicator.visible
-
- Text {
- id: label;
- width:65;
- enabled: textWithLabel.enabled
- color: enabled ? "#242424" : "lightgrey"
- anchors.verticalCenter: parent.verticalCenter
-
- font.pixelSize: 14
- }
-
- Rectangle {
- id: inputRectangle
- width: textWithLabel.width - label.width; height: inputField.font.pixelSize * 1.5
- color: enabled ? "white" : "ghostwhite"
-
- radius: 5
- TextInput {
- id: inputField
- width: parent.width - anchors.leftMargin
- enabled: textWithLabel.enabled
- color: enabled ? "#242424" : "lightgrey"
- horizontalAlignment: Text.AlignLeft
-
- anchors {
- left: parent.left;
- verticalCenter: parent.verticalCenter;
- leftMargin: 5
- }
- font.pixelSize: 14
-
- BusyIndicator {
- id: busyIndicator
- height: parent.height * 0.8
- width: height
- anchors.verticalCenter: parent.verticalCenter
- anchors.rightMargin: parent.height * 0.1
- anchors.topMargin: parent.height * 0.1
- anchors.top: parent.top
- anchors.right: parent.right
- visible: false
- }
- }
- }
-}
diff --git a/examples/location/common/imports/QtLocation/examples/components/style/ButtonStyle.qml b/examples/location/common/imports/QtLocation/examples/components/style/ButtonStyle.qml
deleted file mode 100644
index c4b845f6..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/style/ButtonStyle.qml
+++ /dev/null
@@ -1,49 +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
-
-QtObject {
- id: buttonStyle
- property string background: "../../../../resources/button.png"
- property string pressedBackground: "../../../../resources/button_pressed.png"
- property string disabledBackground: "../../../../resources/button.png"
- property color fontcolor_normal: "white"
- property color fontcolor_selected: "#1c94fc"
-}
diff --git a/examples/location/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml b/examples/location/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml
deleted file mode 100644
index 19933cb8..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml
+++ /dev/null
@@ -1,49 +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
-
-ButtonStyle {
- background: "../../../../resources/hmenuItem.png"
- pressedBackground: "../../../../resources/hmenuItem_pressed.png"
- disabledBackground: "../../../../resources/hmenuItem.png"
- fontcolor_normal: "#242424"
- fontcolor_selected: "#1c94fc"
-}
diff --git a/examples/location/common/imports/QtLocation/examples/components/style/VMenuItemStyle.qml b/examples/location/common/imports/QtLocation/examples/components/style/VMenuItemStyle.qml
deleted file mode 100644
index e180a296..00000000
--- a/examples/location/common/imports/QtLocation/examples/components/style/VMenuItemStyle.qml
+++ /dev/null
@@ -1,44 +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
-
-HMenuItemStyle {
- background: "../../../../resources/vmenuItem.png"
-}
diff --git a/examples/location/common/imports/QtLocation/examples/dialogs/Dialog.qml b/examples/location/common/imports/QtLocation/examples/dialogs/Dialog.qml
deleted file mode 100644
index 65bea08e..00000000
--- a/examples/location/common/imports/QtLocation/examples/dialogs/Dialog.qml
+++ /dev/null
@@ -1,156 +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 "../components"
-
-Item {
- id: dialog
-
- signal goButtonClicked
- signal cancelButtonClicked
- signal clearButtonClicked
-
- property alias title: titleBar.text
-
- property int gap: 10
- property bool showButtons: true
- property Item item
-
- opacity: 0
- anchors.fill: parent
- enabled: opacity > 0 ? true : false
-
- Fader {}
-
- onItemChanged: {
- if (item)
- item.parent = dataRect;
- }
-
- Rectangle {
- id: dialogRectangle
-
- property int maximumDialogHeight: {
- if (dialog.opacity === 0 ||
- (Qt.inputMethod.keyboardRectangle.width === 0 && Qt.inputMethod.keyboardRectangle.height === 0)) {
- return dialog.height;
- } else {
- return dialog.mapFromItem(null, Qt.inputMethod.keyboardRectangle.x, Qt.inputMethod.keyboardRectangle.y).y
- }
- }
- property int maximumContentHeight: maximumDialogHeight - titleBar.height - buttons.height - gap*1.5
-
- color: "#ECECEC"
- opacity: parent.opacity
-
- height: dataRect.height + titleBar.height + buttons.height + gap*1.5
- y: (maximumDialogHeight - height) / 2
- anchors.left: parent.left
- anchors.leftMargin: gap/2
- anchors.right: parent.right
- anchors.rightMargin: gap/2
-
- radius: 5
-
- TitleBar {
- id: titleBar;
-
- height: 40
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- opacity: 0.9
- onClicked: {
- Qt.inputMethod.hide();
- dialog.cancelButtonClicked();
- }
-
- }
-
- Rectangle {
- id: dataRect
- color: "#ECECEC"
- radius: 5
-
- anchors.top: titleBar.bottom
- anchors.left: dialogRectangle.left
- anchors.right: dialogRectangle.right
- anchors.margins: gap/2
- height: Math.min(dialogRectangle.maximumContentHeight, item ? item.implicitHeight : 0)
-
- Binding {
- target: item
- property: "anchors.fill"
- value: dataRect
- }
- Binding {
- target: item
- property: "anchors.margins"
- value: gap/2
- }
- }
-
- Row {
- id: buttons
- anchors.top: dataRect.bottom
- anchors.topMargin: gap/2
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: gap/3
- height: 32
- visible: showButtons
- Button {
- id: buttonClearAll
- text: "Clear"
- width: 80
- height: parent.height
- onClicked: dialog.clearButtonClicked()
- }
- Button {
- id: buttonGo
- text: "Go!"
- width: 80
- height: parent.height
- onClicked: dialog.goButtonClicked()
- }
- }
- }
-}
diff --git a/examples/location/common/imports/QtLocation/examples/qmldir b/examples/location/common/imports/QtLocation/examples/qmldir
deleted file mode 100644
index 9089f6c0..00000000
--- a/examples/location/common/imports/QtLocation/examples/qmldir
+++ /dev/null
@@ -1,13 +0,0 @@
-BusyIndicator 5.0 components/BusyIndicator.qml
-Button 5.0 components/Button.qml
-Checkbox 5.0 components/Checkbox.qml
-Fader 5.0 components/Fader.qml
-IconButton 5.0 components/IconButton.qml
-Menu 5.0 components/Menu.qml
-Optionbutton 5.0 components/Optionbutton.qml
-Slider 5.0 components/Slider.qml
-TextWithLabel 5.0 components/TextWithLabel.qml
-TitleBar 5.0 components/TitleBar.qml
-Dialog 5.0 dialogs/Dialog.qml
-ErrorDialog 5.0 dialogs/ErrorDialog.qml
-InputDialog 5.0 dialogs/InputDialog.qml
diff --git a/examples/location/common/resources/busy.png b/examples/location/common/resources/busy.png
deleted file mode 100755
index 3cca7dab..00000000
--- a/examples/location/common/resources/busy.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/button.png b/examples/location/common/resources/button.png
deleted file mode 100644
index 1e3e752c..00000000
--- a/examples/location/common/resources/button.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/button_pressed.png b/examples/location/common/resources/button_pressed.png
deleted file mode 100644
index 21d9835f..00000000
--- a/examples/location/common/resources/button_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/catch.png b/examples/location/common/resources/catch.png
deleted file mode 100644
index c4fbba40..00000000
--- a/examples/location/common/resources/catch.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/categories_pressed.png b/examples/location/common/resources/categories_pressed.png
deleted file mode 100644
index 965e0ad7..00000000
--- a/examples/location/common/resources/categories_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/checkbox.png b/examples/location/common/resources/checkbox.png
deleted file mode 100644
index b9aab540..00000000
--- a/examples/location/common/resources/checkbox.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/checkbox_selected.png b/examples/location/common/resources/checkbox_selected.png
deleted file mode 100644
index 28b32f58..00000000
--- a/examples/location/common/resources/checkbox_selected.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/cross.png b/examples/location/common/resources/cross.png
deleted file mode 100644
index 835cd91a..00000000
--- a/examples/location/common/resources/cross.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/cross_hovered.png b/examples/location/common/resources/cross_hovered.png
deleted file mode 100644
index fdd23d79..00000000
--- a/examples/location/common/resources/cross_hovered.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/cross_pressed.png b/examples/location/common/resources/cross_pressed.png
deleted file mode 100644
index c7a692af..00000000
--- a/examples/location/common/resources/cross_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/hmenuItem.png b/examples/location/common/resources/hmenuItem.png
deleted file mode 100644
index f2461f2d..00000000
--- a/examples/location/common/resources/hmenuItem.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/hmenuItem_pressed.png b/examples/location/common/resources/hmenuItem_pressed.png
deleted file mode 100644
index 43336d1e..00000000
--- a/examples/location/common/resources/hmenuItem_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/left_pressed.png b/examples/location/common/resources/left_pressed.png
deleted file mode 100644
index b4fee456..00000000
--- a/examples/location/common/resources/left_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/marker.png b/examples/location/common/resources/marker.png
deleted file mode 100644
index 86ec960e..00000000
--- a/examples/location/common/resources/marker.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/marker_hovered.png b/examples/location/common/resources/marker_hovered.png
deleted file mode 100644
index 902ae591..00000000
--- a/examples/location/common/resources/marker_hovered.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/marker_selected.png b/examples/location/common/resources/marker_selected.png
deleted file mode 100644
index f4bf8921..00000000
--- a/examples/location/common/resources/marker_selected.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/node.png b/examples/location/common/resources/node.png
deleted file mode 100644
index 46e85672..00000000
--- a/examples/location/common/resources/node.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/node_selected.png b/examples/location/common/resources/node_selected.png
deleted file mode 100644
index a967f3cf..00000000
--- a/examples/location/common/resources/node_selected.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/option_button.png b/examples/location/common/resources/option_button.png
deleted file mode 100644
index 90970424..00000000
--- a/examples/location/common/resources/option_button.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/option_button_selected.png b/examples/location/common/resources/option_button_selected.png
deleted file mode 100644
index f1196286..00000000
--- a/examples/location/common/resources/option_button_selected.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/pencil.png b/examples/location/common/resources/pencil.png
deleted file mode 100644
index a52cff02..00000000
--- a/examples/location/common/resources/pencil.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/pencil_hovered.png b/examples/location/common/resources/pencil_hovered.png
deleted file mode 100644
index 55053fc1..00000000
--- a/examples/location/common/resources/pencil_hovered.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/pencil_pressed.png b/examples/location/common/resources/pencil_pressed.png
deleted file mode 100644
index f30f3703..00000000
--- a/examples/location/common/resources/pencil_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/quit.png b/examples/location/common/resources/quit.png
deleted file mode 100644
index 9a5cb8a2..00000000
--- a/examples/location/common/resources/quit.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/quit_hovered.png b/examples/location/common/resources/quit_hovered.png
deleted file mode 100644
index bea8f251..00000000
--- a/examples/location/common/resources/quit_hovered.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/quit_pressed.png b/examples/location/common/resources/quit_pressed.png
deleted file mode 100644
index e69aa111..00000000
--- a/examples/location/common/resources/quit_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/right_pressed.png b/examples/location/common/resources/right_pressed.png
deleted file mode 100644
index 111f386b..00000000
--- a/examples/location/common/resources/right_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/search_pressed.png b/examples/location/common/resources/search_pressed.png
deleted file mode 100644
index 23c92fa3..00000000
--- a/examples/location/common/resources/search_pressed.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/titlebar.png b/examples/location/common/resources/titlebar.png
deleted file mode 100644
index 5b1d09a1..00000000
--- a/examples/location/common/resources/titlebar.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/resources/titlebar.sci b/examples/location/common/resources/titlebar.sci
deleted file mode 100644
index 0418d94c..00000000
--- a/examples/location/common/resources/titlebar.sci
+++ /dev/null
@@ -1,5 +0,0 @@
-border.left: 10
-border.top: 12
-border.bottom: 12
-border.right: 10
-source: titlebar.png
diff --git a/examples/location/common/resources/vmenuItem.png b/examples/location/common/resources/vmenuItem.png
deleted file mode 100644
index 9e4385e7..00000000
--- a/examples/location/common/resources/vmenuItem.png
+++ /dev/null
Binary files differ
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/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/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/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
- }
- }
- }
- }
-}
diff --git a/examples/location/places/content/places/PlaceEditorials.qml b/examples/location/places/forms/Message.qml
index ee5ead1b..5d12c1f9 100644
--- a/examples/location/places/content/places/PlaceEditorials.qml
+++ b/examples/location/places/forms/Message.qml
@@ -38,21 +38,21 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
+import QtQuick 2.5
-Item {
- anchors.fill: parent
+MessageForm {
+ property string title
+ property string message
+ property variant backPage
- clip: true
+ signal closeForm(variant backPage)
- //! [PlaceEditorialModel view]
- ListView {
- anchors.fill: parent
-
- model: place.editorialModel
+ button.onClicked: {
+ closeForm(backPage)
+ }
- delegate: EditorialDelegate { }
+ Component.onCompleted: {
+ messageText.text = message
+ messageTitle.text = title
}
- //! [PlaceEditorialModel view]
}
diff --git a/examples/location/places/content/places/EditorialPage.qml b/examples/location/places/forms/MessageForm.ui.qml
index c71af9e3..a3008413 100644
--- a/examples/location/places/content/places/EditorialPage.qml
+++ b/examples/location/places/forms/MessageForm.ui.qml
@@ -38,56 +38,69 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
+import QtQuick 2.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
Item {
- anchors.fill: parent
+ id: root
+ property alias messageText: messageText
+ property alias messageTitle: messageTitle
+ property alias button: button
- property variant d: parent ? parent.data : null
+ Rectangle {
+ id: tabRectangle
+ y: 20
+ height: messageTitle.height * 2
+ color: "#46a2da"
+ anchors.rightMargin: 0
+ anchors.leftMargin: 0
+ anchors.left: parent.left
+ anchors.right: parent.right
- Flickable {
- anchors.fill: parent
-
- contentHeight: c.height
- contentWidth: width
+ Label {
+ id: messageTitle
+ color: "#ffffff"
+ text: qsTr("type")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
- Column {
- id: c
+ Item {
+ anchors.rightMargin: 20
+ anchors.leftMargin: 20
+ anchors.bottomMargin: 20
+ anchors.topMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: tabRectangle.bottom
- width: parent.width
- clip: true
+ ColumnLayout {
+ id: columnLayout1
+ spacing: 20
+ anchors.fill: parent
- Text {
- text: d ? d.title : ""
- width: parent.width
+ Label {
+ id: messageText
+ text: qsTr("message")
+ Layout.fillWidth: true
+ horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
- font.pixelSize: 24
+ textFormat: Text.RichText
}
- Text {
- text: d ? d.text : ""
- width: parent.width
- wrapMode: Text.WordWrap
- font.pixelSize: 20
+ Button {
+ id: button
+ text: qsTr("OK")
+ Layout.alignment: Qt.AlignHCenter
}
- 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
+ Item {
+ Layout.fillHeight: true
}
}
}
}
+
diff --git a/examples/location/places/forms/PlaceDetails.qml b/examples/location/places/forms/PlaceDetails.qml
new file mode 100644
index 00000000..7d7a6981
--- /dev/null
+++ b/examples/location/places/forms/PlaceDetails.qml
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** 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.5
+import "../helper.js" as Helper
+
+PlaceDetailsForm {
+
+ property variant place
+ property real distanceToPlace
+
+ signal searchForSimilar(variant place)
+ signal showReviews(variant place)
+ signal showEditorials(variant place)
+ signal showImages(variant place)
+
+ function placeAddress(place) {
+ if (!place)
+ return "";
+
+ if (place.location.address.text.length > 0)
+ return place.location.address.text;
+
+ return place.location.address.street;
+ }
+
+ 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;
+ }
+
+ function additonalInformation(place) {
+ var keys = place.extendedAttributes.keys();
+ var result;
+
+ for (var i = 0; i < keys.length; ++i) {
+ var label = place.extendedAttributes[keys[i]].label;
+ var text = place.extendedAttributes[keys[i]].text;
+ if (label) {
+ result += label + ": "
+ if (text)
+ result += text
+ result += "<br/>"
+ }
+ }
+
+ if (!result)
+ result = qsTr("No information")
+
+ return result;
+ }
+
+ editorialsButton.onClicked: showEditorials(place)
+ imagesButton.onClicked: showImages(place)
+ reviewsButton.onClicked: showReviews(place)
+ findSimilarButton.onClicked: searchForSimilar(place)
+
+ Component.onCompleted: {
+ placeName.text = place ? (place.favorite ? place.favorite.name : place.name) : ""
+ placeIcon.source = place ? (place.favorite ? place.favorite.icon.url(Qt.size(40,40))
+ : place.icon.url() == "" ?
+ "../resources/marker.png"
+ : place.icon.url(Qt.size(40,40))) : ""
+ ratingView.rating = (place && place.ratings) ? place.ratings.average : 0
+ distance.text = Helper.formatDistance(distanceToPlace)
+ address.text = placeAddress(place)
+ categories.text = place ? categoryNames(place.categories) : ""
+ phone.text = place ? place.primaryPhone : ""
+ fax.text = place ? place.primaryFax : ""
+ email.text = place ? place.primaryEmail : ""
+ website.text = place ? '<a href=\"' + place.primaryWebsite + '\">' + place.primaryWebsite + '</a>' : ""
+ addInformation.text = place ? additonalInformation(place) : ""
+ if (place) {
+ editorialsButton.enabled = Qt.binding(function(){ return place && place.editorialModel.totalCount > 0 })
+ reviewsButton.enabled = Qt.binding(function(){ return place && place.reviewModel.totalCount > 0 })
+ imagesButton.enabled = Qt.binding(function(){ return place && place.imageModel.totalCount > 0 })
+ findSimilarButton.enabled = true
+ }
+ }
+}
+
diff --git a/examples/location/places/forms/PlaceDetailsForm.ui.qml b/examples/location/places/forms/PlaceDetailsForm.ui.qml
new file mode 100644
index 00000000..f13b9b5a
--- /dev/null
+++ b/examples/location/places/forms/PlaceDetailsForm.ui.qml
@@ -0,0 +1,285 @@
+/****************************************************************************
+**
+** 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.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+import "../views"
+
+Item {
+ id: root
+ property alias placeName: placeName
+ property alias placeIcon: placeIcon
+ property alias distance: distance
+ property alias address: address
+ property alias categories: categories
+ property alias phone: phone
+ property alias fax: fax
+ property alias email: email
+ property alias website: website
+ property alias addInformation: addInformation
+ property alias editorialsButton: editorialsButton
+ property alias reviewsButton: reviewsButton
+ property alias imagesButton: imagesButton
+ property alias findSimilarButton: findSimilarButton
+ property alias ratingView: ratingView
+ width: parent.width
+ height: parent.height
+
+ ScrollView {
+ id:scrollView
+ flickableItem.interactive: true
+ anchors.fill: parent
+ anchors.margins: 15
+
+ GridLayout {
+ width: scrollView.width - 15
+ rows: 7
+ columns: 2
+
+ RowLayout {
+ Layout.columnSpan: 2
+ Layout.fillWidth: true
+
+ Image {
+ id: placeIcon
+ source: "../resources/marker.png"
+ anchors.margins: 30
+ }
+
+ Label {
+ id: placeName
+ text: qsTr("PlaceName")
+ font.bold: true
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+ }
+
+ RatingView {
+ id: ratingView
+ size: placeName.height * 2
+ Layout.columnSpan: 2
+ }
+
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ Layout.columnSpan: 2
+ height: 1
+ color: "#46a2da"
+ visible: addressBox.visible
+ }
+
+ GroupBox {
+ id: addressBox
+ Layout.fillWidth: true
+ Layout.columnSpan: 2
+ flat: true
+ title: qsTr("Address")
+
+ GridLayout {
+ id: gridLayout3
+ rowSpacing: 10
+ rows: 1
+ columns: 2
+ anchors.fill: parent
+
+ Label {
+ text: qsTr("Distance:")
+ }
+
+ Label {
+ id: distance
+ Layout.fillWidth: true
+ text: qsTr("1000 km")
+ }
+
+ Label {
+ id: address
+ Layout.columnSpan: 2
+ text: qsTr("Street Number<br/>xxxxx City<br/>Country")
+ }
+ }
+ }
+
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ Layout.columnSpan: 2
+ height: 1
+ color: "#46a2da"
+ visible: categoriesBox.visible
+ }
+
+ GroupBox {
+ id: categoriesBox
+ Layout.fillWidth: true
+ Layout.columnSpan: 2
+ flat: true
+ title: qsTr("Categories")
+
+ Label {
+ id: categories
+ anchors.fill: parent
+ text: qsTr("category1, category2 ,category3")
+ }
+ }
+
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 1
+ color: "#46a2da"
+ visible: contactDetailsBox.visible
+ }
+
+ GroupBox {
+ id: contactDetailsBox
+ Layout.fillWidth: true
+ Layout.columnSpan: 2
+ flat: true
+ title: qsTr("Contact details")
+ GridLayout {
+ id: gridLayout4
+ rowSpacing: 10
+ rows: 1
+ columns: 2
+ anchors.fill: parent
+
+ Label {
+ text: qsTr("Phone: ")
+ }
+
+ Label {
+ id: phone
+ Layout.fillWidth: true
+ text: qsTr("000-000-000")
+ }
+
+ Label {
+ text: qsTr("Fax: ")
+ }
+
+ Label {
+ id: fax
+ Layout.fillWidth: true
+ text: qsTr("000-000-000")
+ }
+
+ Label {
+ text: qsTr("Email: ")
+ }
+
+ Label {
+ id: email
+ Layout.fillWidth: true
+ text: qsTr("name@company.com")
+ }
+
+ Label {
+ text: qsTr("Website: ")
+ }
+
+ Label {
+ id: website
+ Layout.fillWidth: true
+ text: qsTr("http:://company.com")
+ }
+ }
+ }
+
+ Rectangle {
+ Layout.columnSpan: 2
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 1
+ color: "#46a2da"
+ visible: informationBox.visible
+ }
+
+ GroupBox {
+ id: informationBox
+ Layout.fillWidth: true
+ Layout.columnSpan: 2
+ flat: true
+ title: qsTr("Additional information")
+ ColumnLayout {
+ Label {
+ id: addInformation
+ text: qsTr("AdditionalInformation1<br/>AdditionalInformation2<br/>AdditionalInformation3")
+ }
+ }
+ }
+
+ RowLayout {
+ Layout.columnSpan: 2
+ Layout.alignment: Qt.AlignHCenter
+
+ Button {
+ id: editorialsButton
+ text: qsTr("Editorials")
+ enabled: false
+ }
+
+ Button {
+ id: reviewsButton
+ text: qsTr("Reviews")
+ enabled: false
+ }
+
+ Button {
+ id: imagesButton
+ text: qsTr("Images")
+ enabled: false
+ }
+
+ Button {
+ id: findSimilarButton
+ text: qsTr("Find similar")
+ enabled: false
+ }
+ }
+ }
+ }
+}
+
diff --git a/examples/location/common/imports/QtLocation/examples/components/Optionbutton.qml b/examples/location/places/forms/SearchBoundingBox.qml
index 2c21f110..10c28636 100644
--- a/examples/location/common/imports/QtLocation/examples/components/Optionbutton.qml
+++ b/examples/location/places/forms/SearchBoundingBox.qml
@@ -37,44 +37,35 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
-Item {
- id: optionbutton
+import QtQuick 2.5
+import QtPositioning 5.5
- signal clicked
+SearchBoundingBoxForm {
+ property variant searchRegion
+ signal changeSearchBoundingBox(variant coordinate, real widthDeg, real heightDeg)
+ signal closeForm()
- property bool selected: false
- property alias text: optionbuttonText.text
- property bool toggle: false
-
- height: optionbuttonText.height
+ goButton.onClicked: {
+ var coordinate = QtPositioning.coordinate(parseFloat(latitude.text),
+ parseFloat(longitude.text));
+ if (coordinate.isValid)
+ changeSearchBoundingBox(coordinate,parseFloat(widthDeg.text),parseFloat(heightDeg.text))
+ }
- Row {
- id: optionbuttonRow
- spacing: 3
- anchors.fill: parent
- Image {
- source: optionbutton.selected ? "../../../../resources/option_button_selected.png" : "../../../../resources/option_button.png"
- }
- Text {
- id: optionbuttonText
- font.pixelSize: 14
- color: "#242424"
- }
+ clearButton.onClicked: {
+ latitude.text = ""
+ longitude.text = ""
+ widthDeg.text = ""
+ heightDeg.text = ""
}
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (toggle) {
- if (optionbutton.selected)
- optionbutton.selected = false
- else
- optionbutton.selected = true
- } else {
- optionbutton.selected = true
- }
- optionbutton.clicked()
- }
+
+ cancelButton.onClicked: closeForm()
+
+ Component.onCompleted: {
+ latitude.text = "" + searchRegion.center.latitude
+ longitude.text = "" + searchRegion.center.longitude
+ widthDeg.text = searchRegion.width ? "" + searchRegion.width : "0.0"
+ heightDeg.text = searchRegion.height ? "" + searchRegion.height: "0.0"
}
}
diff --git a/examples/location/places/forms/SearchBoundingBoxForm.ui.qml b/examples/location/places/forms/SearchBoundingBoxForm.ui.qml
new file mode 100644
index 00000000..4bae3d65
--- /dev/null
+++ b/examples/location/places/forms/SearchBoundingBoxForm.ui.qml
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** 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.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+
+Item {
+ property alias clearButton: clearButton
+ property alias goButton: goButton
+ property alias longitude: longitude
+ property alias latitude: latitude
+ property alias widthDeg: widthDeg
+ property alias heightDeg: heightDeg
+ property alias cancelButton: cancelButton
+ property alias tabTitle: tabTitle
+ Rectangle {
+ id: tabRectangle
+ y: 20
+ height: tabTitle.height * 2
+ color: "#46a2da"
+ anchors.rightMargin: 0
+ anchors.leftMargin: 0
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ Label {
+ id: tabTitle
+ color: "#ffffff"
+ text: qsTr("Search Bounding Box")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Item {
+ id: item2
+ anchors.rightMargin: 20
+ anchors.leftMargin: 20
+ anchors.bottomMargin: 20
+ anchors.topMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: tabRectangle.bottom
+
+ GridLayout {
+ id: gridLayout3
+ anchors.rightMargin: 0
+ anchors.bottomMargin: 0
+ anchors.leftMargin: 0
+ anchors.topMargin: 0
+ rowSpacing: 10
+ rows: 1
+ columns: 2
+ anchors.fill: parent
+
+ Label {
+ id: label2
+ text: qsTr("Latitude")
+ }
+
+ TextField {
+ id: latitude
+ Layout.fillWidth: true
+ }
+
+ Label {
+ id: label3
+ text: qsTr("Longitude")
+ }
+
+ TextField {
+ id: longitude
+ Layout.fillWidth: true
+ placeholderText: qsTr("")
+ }
+
+ Label {
+ id: label4
+ text: qsTr("Width (deg)")
+ }
+
+ TextField {
+ id: widthDeg
+ Layout.fillWidth: true
+ }
+
+ Label {
+ id: label5
+ text: qsTr("Height (deg)")
+ }
+
+ TextField {
+ id: heightDeg
+ Layout.fillWidth: true
+ placeholderText: qsTr("")
+ }
+
+ RowLayout {
+ id: rowLayout1
+ Layout.columnSpan: 2
+ Layout.alignment: Qt.AlignRight
+
+ Button {
+ id: goButton
+ text: qsTr("Set")
+ }
+
+ Button {
+ id: clearButton
+ text: qsTr("Clear")
+ }
+
+ Button {
+ id: cancelButton
+ text: qsTr("Cancel")
+ }
+ }
+ Item {
+ Layout.fillHeight: true
+ Layout.columnSpan: 2
+ }
+ }
+ }
+}
diff --git a/examples/location/places/forms/SearchBoundingCircle.qml b/examples/location/places/forms/SearchBoundingCircle.qml
new file mode 100644
index 00000000..ce6212a8
--- /dev/null
+++ b/examples/location/places/forms/SearchBoundingCircle.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** 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.5
+import QtPositioning 5.5
+
+SearchBoundingCircleForm {
+ property variant searchRegion
+ signal changeSearchBoundingCircle(variant coordinate, real radius)
+ signal closeForm()
+
+ goButton.onClicked: {
+ var coordinate = QtPositioning.coordinate(parseFloat(latitude.text),
+ parseFloat(longitude.text));
+ if (coordinate.isValid)
+ changeSearchBoundingCircle(coordinate,parseFloat(radius.text))
+ }
+
+ clearButton.onClicked: {
+ latitude.text = ""
+ longitude.text = ""
+ radius.text = ""
+ }
+
+ cancelButton.onClicked: closeForm()
+
+ Component.onCompleted: {
+ latitude.text = "" + searchRegion.center.latitude
+ longitude.text = "" + searchRegion.center.longitude
+ radius.text = searchRegion.radius ? "" + searchRegion.radius : "0.0"
+ }
+}
diff --git a/examples/location/places/forms/SearchBoundingCircleForm.ui.qml b/examples/location/places/forms/SearchBoundingCircleForm.ui.qml
new file mode 100644
index 00000000..9bfd996e
--- /dev/null
+++ b/examples/location/places/forms/SearchBoundingCircleForm.ui.qml
@@ -0,0 +1,151 @@
+/****************************************************************************
+**
+** 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.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+
+Item {
+ property alias clearButton: clearButton
+ property alias goButton: goButton
+ property alias longitude: longitude
+ property alias latitude: latitude
+ property alias radius: radius
+ property alias cancelButton: cancelButton
+ property alias tabTitle: tabTitle
+ Rectangle {
+ id: tabRectangle
+ y: 20
+ height: tabTitle.height * 2
+ color: "#46a2da"
+ anchors.rightMargin: 0
+ anchors.leftMargin: 0
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ Label {
+ id: tabTitle
+ color: "#ffffff"
+ text: qsTr("Search Bounding Circle")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Item {
+ id: item2
+ anchors.rightMargin: 20
+ anchors.leftMargin: 20
+ anchors.bottomMargin: 20
+ anchors.topMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: tabRectangle.bottom
+
+ GridLayout {
+ id: gridLayout3
+ anchors.rightMargin: 0
+ anchors.bottomMargin: 0
+ anchors.leftMargin: 0
+ anchors.topMargin: 0
+ rowSpacing: 10
+ rows: 1
+ columns: 2
+ anchors.fill: parent
+
+ Label {
+ id: label2
+ text: qsTr("Latitude")
+ }
+
+ TextField {
+ id: latitude
+ Layout.fillWidth: true
+ }
+
+ Label {
+ id: label3
+ text: qsTr("Longitude")
+ }
+
+ TextField {
+ id: longitude
+ Layout.fillWidth: true
+ placeholderText: qsTr("")
+ }
+
+ Label {
+ id: label4
+ text: qsTr("Radius (m)")
+ }
+
+ TextField {
+ id: radius
+ Layout.fillWidth: true
+ }
+
+ RowLayout {
+ id: rowLayout1
+ Layout.columnSpan: 2
+ Layout.alignment: Qt.AlignRight
+
+ Button {
+ id: goButton
+ text: qsTr("Set")
+ }
+
+ Button {
+ id: clearButton
+ text: qsTr("Clear")
+ }
+
+ Button {
+ id: cancelButton
+ text: qsTr("Cancel")
+ }
+ }
+ Item {
+ Layout.fillHeight: true
+ Layout.columnSpan: 2
+ }
+ }
+ }
+}
diff --git a/examples/location/common/imports/QtLocation/examples/components/Checkbox.qml b/examples/location/places/forms/SearchCenter.qml
index 6fba11ef..b8fbda61 100644
--- a/examples/location/common/imports/QtLocation/examples/components/Checkbox.qml
+++ b/examples/location/places/forms/SearchCenter.qml
@@ -37,29 +37,34 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
-Item {
- id: checkbox
- property bool selected: false
- property alias text: checkboxText.text
- height: checkboxText.height
+import QtQuick 2.5
+import QtPositioning 5.5
- Row {
- id: checkboxRow
- spacing: 3
- anchors.fill: parent
- Image {
- source: checkbox.selected ? "../../../../resources/checkbox_selected.png" : "../../../../resources/checkbox.png"
- }
- Text {
- id: checkboxText
- font.pixelSize: 14
- color: "#242424"
- }
+SearchCenterForm {
+ property string title;
+ property variant coordinate
+ signal changeSearchCenter(variant coordinate)
+ signal closeForm()
+
+ goButton.onClicked: {
+ var coordinate = QtPositioning.coordinate(parseFloat(latitude.text),
+ parseFloat(longitude.text));
+ if (coordinate.isValid)
+ changeSearchCenter(coordinate)
+ }
+
+ clearButton.onClicked: {
+ latitude.text = ""
+ longitude.text = ""
}
- MouseArea {
- anchors.fill: parent
- onClicked: { checkbox.selected = !checkbox.selected }
+
+ cancelButton.onClicked: closeForm()
+
+ Component.onCompleted: {
+ latitude.text = "" + coordinate.latitude
+ longitude.text = "" + coordinate.longitude
+ if (title.length != 0)
+ tabTitle.text = title;
}
}
diff --git a/examples/location/places/forms/SearchCenterForm.ui.qml b/examples/location/places/forms/SearchCenterForm.ui.qml
new file mode 100644
index 00000000..f303b071
--- /dev/null
+++ b/examples/location/places/forms/SearchCenterForm.ui.qml
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** 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.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+
+Item {
+ property alias clearButton: clearButton
+ property alias goButton: goButton
+ property alias longitude: longitude
+ property alias latitude: latitude
+ property alias cancelButton: cancelButton
+ property alias tabTitle: tabTitle
+ Rectangle {
+ id: tabRectangle
+ y: 20
+ height: tabTitle.height * 2
+ color: "#46a2da"
+ anchors.rightMargin: 0
+ anchors.leftMargin: 0
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ Label {
+ id: tabTitle
+ color: "#ffffff"
+ text: qsTr("Search Center")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Item {
+ id: item2
+ anchors.rightMargin: 20
+ anchors.leftMargin: 20
+ anchors.bottomMargin: 20
+ anchors.topMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: tabRectangle.bottom
+
+ GridLayout {
+ id: gridLayout3
+ anchors.rightMargin: 0
+ anchors.bottomMargin: 0
+ anchors.leftMargin: 0
+ anchors.topMargin: 0
+ rowSpacing: 10
+ rows: 1
+ columns: 2
+ anchors.fill: parent
+
+ Label {
+ id: label2
+ text: qsTr("Latitude")
+ }
+
+ TextField {
+ id: latitude
+ Layout.fillWidth: true
+ }
+
+ Label {
+ id: label3
+ text: qsTr("Longitude")
+ }
+
+ TextField {
+ id: longitude
+ Layout.fillWidth: true
+ placeholderText: qsTr("")
+ }
+
+ RowLayout {
+ id: rowLayout1
+ Layout.columnSpan: 2
+ Layout.alignment: Qt.AlignRight
+
+ Button {
+ id: goButton
+ text: qsTr("Set")
+ }
+
+ Button {
+ id: clearButton
+ text: qsTr("Clear")
+ }
+
+ Button {
+ id: cancelButton
+ text: qsTr("Cancel")
+ }
+ }
+ Item {
+ Layout.fillHeight: true
+ Layout.columnSpan: 2
+ }
+ }
+ }
+}
diff --git a/examples/location/places/content/places/CategoryView.qml b/examples/location/places/forms/SearchOptions.qml
index 18495f73..80309f0a 100644
--- a/examples/location/places/content/places/CategoryView.qml
+++ b/examples/location/places/forms/SearchOptions.qml
@@ -38,50 +38,41 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
-import QtLocation.examples 5.0
+import QtQuick 2.5
+import QtLocation 5.5
+import QtPositioning 5.5
-
-//! [CategoryModel view 1]
-ListView {
+SearchOptionsForm {
id: root
+ property Plugin plugin
+ property PlaceSearchModel model
- 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
+ signal changeSearchSettings(bool orderByDistance,
+ bool orderByName,
+ string locales)
+ signal closeForm()
- clip: true
- snapMode: ListView.SnapToItem
- spacing: 5
+ setButton.onClicked: changeSearchSettings(distanceOrderButton.checked,
+ nameOrderButton.checked,
+ locales.text)
-//! [CategoryModel view 2]
- header: IconButton {
- source: "../../resources/left.png"
- pressedSource: "../../resources/left_pressed.png"
- onClicked: categoryListModel.rootIndex = categoryListModel.parentModelIndex()
+ clearButton.onClicked: {
+ locales.text = ""
+ distanceOrderButton.checked = false
+ nameOrderButton.checked = false
}
-//! [CategoryModel view 2]
-//! [CategoryModel view 3]
- model: VisualDataModel {
- id: categoryListModel
- model: categoryModel
- delegate: CategoryDelegate {
- id: categoryDelegate
-
- showChildren: root.showChildren
+ cancelButton.onClicked: {
+ closeForm()
+ }
- onClicked: root.categoryClicked(category);
- onArrowClicked: categoryListModel.rootIndex = categoryListModel.modelIndex(index)
- }
+ Component.onCompleted: {
+ locales.visible = root.plugin != null && root.plugin.supportsPlaces(Plugin.LocalizedPlacesFeature);
+ favoritesButton.visible = false;
+// favoritesButton.enabled = placeSearchModel.favoritesPlugin !== null)
+// isFavoritesEnabled = true;
+ locales.text = root.plugin.locales.join(Qt.locale().groupSeparator);
+ distanceOrderButton.checked = model.relevanceHint == PlaceSearchModel.DistanceHint
+ nameOrderButton.checked = model.relevanceHint == PlaceSearchModel.LexicalPlaceNameHint
}
}
-//! [CategoryModel view 3]
diff --git a/examples/location/places/forms/SearchOptionsForm.ui.qml b/examples/location/places/forms/SearchOptionsForm.ui.qml
new file mode 100644
index 00000000..945a3890
--- /dev/null
+++ b/examples/location/places/forms/SearchOptionsForm.ui.qml
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** 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.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+
+Item {
+ property alias clearButton: clearButton
+ property alias setButton: setButton
+ property alias cancelButton: cancelButton
+ property alias tabTitle: tabTitle
+ property alias orderGroup: orderGroup
+ property alias distanceOrderButton: distanceOrderButton
+ property alias nameOrderButton: nameOrderButton
+ property alias favoritesButton: favoritesButton
+ property alias locales: locales
+
+ Rectangle {
+ id: tabRectangle
+ y: 20
+ height: tabTitle.height * 2
+ color: "#46a2da"
+ anchors.rightMargin: 0
+ anchors.leftMargin: 0
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ Label {
+ id: tabTitle
+ color: "#ffffff"
+ text: qsTr("Search Options")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Item {
+ id: item2
+ anchors.rightMargin: 20
+ anchors.leftMargin: 20
+ anchors.bottomMargin: 20
+ anchors.topMargin: 20
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: tabRectangle.bottom
+
+ GridLayout {
+ id: gridLayout3
+ anchors.rightMargin: 0
+ anchors.bottomMargin: 0
+ anchors.leftMargin: 0
+ anchors.topMargin: 0
+ rowSpacing: 10
+ rows: 1
+ columns: 2
+ anchors.fill: parent
+
+ Label {
+ id: label
+ text: qsTr("Locale(s)")
+ visible: locales.visible
+ }
+
+ TextField {
+ id: locales
+ Layout.fillWidth: true
+ placeholderText: qsTr("")
+ }
+
+ RadioButton {
+ id: favoritesButton
+ text: qsTr("Enable favorites")
+ Layout.columnSpan: 2
+ }
+
+ ExclusiveGroup { id: orderGroup }
+ RadioButton {
+ id: distanceOrderButton
+ text: qsTr("Order by distance")
+ exclusiveGroup: orderGroup
+ Layout.columnSpan: 2
+ }
+
+ RadioButton {
+ id: nameOrderButton
+ text: qsTr("Order by name")
+ exclusiveGroup: orderGroup
+ Layout.columnSpan: 2
+ }
+
+ RowLayout {
+ id: rowLayout1
+ Layout.columnSpan: 2
+ Layout.alignment: Qt.AlignRight
+
+ Button {
+ id: setButton
+ text: qsTr("Set")
+ }
+
+ Button {
+ id: clearButton
+ text: qsTr("Clear")
+ }
+
+ Button {
+ id: cancelButton
+ text: qsTr("Cancel")
+ }
+ }
+
+ Item {
+ Layout.fillHeight: true
+ Layout.columnSpan: 2
+ }
+
+
+ }
+ }
+}
diff --git a/examples/location/common/imports/QtLocation/examples/dialogs/ErrorDialog.qml b/examples/location/places/helper.js
index e864cd57..5b090225 100644
--- a/examples/location/common/imports/QtLocation/examples/dialogs/ErrorDialog.qml
+++ b/examples/location/places/helper.js
@@ -38,21 +38,16 @@
**
****************************************************************************/
-import QtQuick 2.0
+.pragma library
-Dialog {
- id: errorRoot
+function formatDistance(distance)
+{
+ if (distance < 1000)
+ return distance.toFixed(0) + " m";
- property string text
- opacity: 0
- showButtons:false
+ var km = distance/1000;
+ if (km < 10)
+ return km.toFixed(1) + " km";
- item: Text {
- id: errorText
- text: errorRoot.text
- }
-
- onCancelButtonClicked: {
- opacity = 0;
- }
+ return km.toFixed(0) + " km";
}
diff --git a/examples/location/places/icon.png b/examples/location/places/icon.png
deleted file mode 100644
index 0954baf0..00000000
--- a/examples/location/places/icon.png
+++ /dev/null
Binary files differ
diff --git a/examples/location/common/imports/QtLocation/examples/components/TitleBar.qml b/examples/location/places/items/MainMenu.qml
index 3ea4f9f3..1437d3c3 100644
--- a/examples/location/common/imports/QtLocation/examples/components/TitleBar.qml
+++ b/examples/location/places/items/MainMenu.qml
@@ -38,50 +38,54 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.5
+import QtQuick.Controls 1.4
+import QtLocation 5.5
-Item {
- id: titleBar
+MenuBar {
+ property variant providerMenu: providerMenu
+ property variant settingsMenu: settingsMenu
- property alias text:titleText.text
- property alias hoverEnabled: mouseRegion.hoverEnabled
- property alias font: titleText.font
- signal clicked
+ signal selectProvider(string providerName)
+ signal selectSetting(string setting);
- BorderImage { source: "../../../../resources/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
- Image {
- id: quitButton
- anchors.right: parent.right; anchors.rightMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- source: "../../../../resources/quit.png"
- MouseArea {
- id: mouseRegion
- hoverEnabled: false
- anchors.fill: parent
- onClicked: { titleBar.clicked(); }
+
+ Menu {
+ id: providerMenu
+ title: qsTr("Provider")
+
+ function createMenu(plugins)
+ {
+ clear()
+ for (var i = 0; i < plugins.length; i++) {
+ createProviderMenuItem(plugins[i]);
+ }
}
- }
- Text {
- id: titleText
- anchors {
- left: parent.left; leftMargin: 10; verticalCenter: parent.verticalCenter
+ function createProviderMenuItem(provider)
+ {
+ var item = addItem(provider);
+ item.checkable = true;
+ item.triggered.connect(function(){selectProvider(provider)})
}
- elide: Text.ElideLeft
- font.bold: true; font.pixelSize: 14; color: "white"; style: Text.Raised; styleColor: "dimgrey"
}
- states: [
- State {
- name: "Pressed"
- when: mouseRegion.pressed
- PropertyChanges { target: quitButton; source: "../../../../resources/quit_pressed.png" }
- },
- State {
- name: "Hover"
- when: mouseRegion.containsMouse
- PropertyChanges { target: quitButton; source: "../../../../resources/quit_hovered.png" }
+ Menu {
+ id: settingsMenu
+ title: qsTr("Settings")
+
+ function createMenu(map)
+ {
+ clear()
+ var item = addItem(qsTr("Search Center"));
+ item.triggered.connect(function(){selectSetting("searchCenter")})
+ item = addItem(qsTr("Search Bounding Box"));
+ item.triggered.connect(function(){selectSetting("searchBoundingBox")})
+ item = addItem(qsTr("Search Bounding Circle"));
+ item.triggered.connect(function(){selectSetting("searchBoundingCircle")})
+ item = addItem(qsTr("Search Options"));
+ item.triggered.connect(function(){selectSetting("SearchOptions")})
}
- ]
+ }
}
diff --git a/examples/location/places/content/places/MapComponent.qml b/examples/location/places/items/MapComponent.qml
index 3b4d7500..de4e04a7 100644
--- a/examples/location/places/content/places/MapComponent.qml
+++ b/examples/location/places/items/MapComponent.qml
@@ -38,200 +38,177 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtPositioning 5.2
-import QtLocation 5.3
-import QtLocation.examples 5.0
+import QtQuick 2.5
+import QtQuick.Controls 1.4
+import QtPositioning 5.5
+import QtLocation 5.5
+import "../helper.js" as Helper
Map {
id: map
- zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
+ 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]
+
+ 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 = Helper.formatDistance(dist)
+ scaleImage.width = (scaleImage.sourceSize.width * f) - 2 * scaleImageLeft.sourceSize.width
+ scaleText.text = text
+ }
+
center {
- // Brisbane
- latitude: -27.5
- longitude: 153
+ // The Qt Company in Oslo
+ latitude: 59.9485
+ longitude: 10.7686
}
gesture.flickDeceleration: 3000
gesture.enabled: true
+ onCopyrightLinkActivated: Qt.openUrlExternally(link)
- 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]
+ onCenterChanged:{
+ scaleTimer.restart()
+ if (map.followme)
+ if (map.center != positionSource.position.coordinate) map.followme = false
+ }
- PositionSource{
- id: positionSource
- active: followme
+ onZoomLevelChanged:{
+ scaleTimer.restart()
+ if (map.followme) map.center = positionSource.position.coordinate
+ }
- onPositionChanged: {
- map.center = positionSource.position.coordinate
- }
+ onWidthChanged:{
+ scaleTimer.restart()
}
- 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
+ onHeightChanged:{
+ scaleTimer.restart()
+ }
+
+ Keys.onPressed: {
+ if (event.key === Qt.Key_Plus) {
+ map.zoomLevel++
+ } else if (event.key === Qt.Key_Minus) {
+ map.zoomLevel--
}
}
- signal coordinatesCaptured(double latitude, double longitude)
+ Timer {
+ id: scaleTimer
+ interval: 100
+ running: false
+ repeat: false
+ onTriggered: {
+ map.calculateScale()
+ }
+ }
- Item {//scale
+ Item {
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
- }
+ z: map.z + 3
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ anchors.margins: 20
+ height: scaleText.height * 2
+ width: scaleImage.width
+
Image {
id: scaleImageLeft
source: "../../resources/scale_end.png"
anchors.bottom: parent.bottom
- anchors.left: parent.left
+ anchors.right: scaleImage.left
}
Image {
id: scaleImage
source: "../../resources/scale.png"
anchors.bottom: parent.bottom
- anchors.left: scaleImageLeft.right
+ anchors.right: scaleImageRight.left
}
Image {
id: scaleImageRight
source: "../../resources/scale_end.png"
anchors.bottom: parent.bottom
- anchors.left: scaleImage.right
+ anchors.right: parent.right
}
- Text {
+ Label {
id: scaleText
color: "#004EAE"
- horizontalAlignment: Text.AlignHCenter
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.bottomMargin: 3
+ anchors.centerIn: parent
text: "0 m"
- font.pixelSize: 14
}
Component.onCompleted: {
map.calculateScale();
}
}
- Timer {
- id: scaleTimer
- interval: 100
- running: false
- repeat: false
- onTriggered: {
- map.calculateScale()
+ MapQuickItem {
+ id: poiTheQtComapny
+ sourceItem: Rectangle { width: 14; height: 14; color: "#e41e25"; border.width: 2; border.color: "white"; smooth: true; radius: 7 }
+ coordinate {
+ latitude: 59.9485
+ longitude: 10.7686
}
+ opacity:1.0
+ anchorPoint: Qt.point(sourceItem.width/2, sourceItem.height/2)
}
- 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
+ MapQuickItem {
+ sourceItem: Text{
+ text: "The Qt Company"
+ color:"#242424"
+ font.bold: true
+ styleColor: "#ECECEC"
+ style: Text.Outline
}
+ coordinate: poiTheQtComapny.coordinate
+ anchorPoint: Qt.point(-poiTheQtComapny.sourceItem.width * 0.5,poiTheQtComapny.sourceItem.height * 1.5)
}
- 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))
+ PositionSource{
+ id: positionSource
+ active: followme
- 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]
- }
+ onPositionChanged: {
+ map.center = positionSource.position.coordinate
}
-
- 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
+ Slider {
+ id: zoomSlider;
+ z: map.z + 3
+ minimumValue: map.minimumZoomLevel;
+ maximumValue: map.maximumZoomLevel;
+ anchors.margins: 10
+ anchors.bottom: scale.top
+ anchors.top: parent.top
+ anchors.right: parent.right
+ orientation : Qt.Vertical
+ value: map.zoomLevel
+ onValueChanged: {
+ map.zoomLevel = value
+ }
}
}
diff --git a/examples/location/places/items/SearchBar.qml b/examples/location/places/items/SearchBar.qml
new file mode 100644
index 00000000..e5a3b330
--- /dev/null
+++ b/examples/location/places/items/SearchBar.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** 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.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+
+ToolBar {
+
+ property bool busyIndicatorRunning : false
+ property bool searchBarVisbile: true
+
+ signal doSearch(string searchText)
+ signal searchTextChanged(string searchText)
+ signal showCategories()
+ signal goBack()
+ signal showMap()
+
+ onSearchBarVisbileChanged: {
+ searchBar.opacity = searchBarVisbile ? 1 : 0
+ backBar.opacity = searchBarVisbile ? 0 : 1
+ }
+
+ function showSearch(text) {
+ if (text != null) {
+ searchText.ignoreTextChange = true
+ searchText.text = text
+ searchText.ignoreTextChange = false
+ }
+ }
+
+ RowLayout {
+ id: searchBar
+ width: parent.width
+ height: parent.height
+ Behavior on opacity { NumberAnimation{} }
+ visible: opacity ? true : false
+ TextField {
+ id: searchText
+ Behavior on opacity { NumberAnimation{} }
+ visible: opacity ? true : false
+ property bool ignoreTextChange: false
+ placeholderText: qsTr("Type place...")
+ Layout.fillWidth: true
+ onTextChanged: {
+ if (!ignoreTextChange)
+ searchTextChanged(text)
+ }
+ onAccepted: doSearch(searchText.text)
+ }
+ ToolButton {
+ id: searchButton
+ iconSource: "../../resources/search.png"
+ onClicked: doSearch(searchText.text)
+ }
+ ToolButton {
+ id: categoryButton
+ iconSource: "../../resources/categories.png"
+ onClicked: showCategories()
+ }
+ }
+
+ RowLayout {
+ id: backBar
+ width: parent.width
+ height: parent.height
+ opacity: 0
+ Behavior on opacity { NumberAnimation{} }
+ visible: opacity ? true : false
+ ToolButton {
+ id: backButton
+ iconSource: "../../resources/left.png"
+ onClicked: goBack()
+ }
+ ToolButton {
+ id: mapButton
+ iconSource: "../../resources/search.png"
+ onClicked: showMap()
+ }
+ Item {
+ Layout.fillWidth: true
+ }
+ }
+}
+
diff --git a/examples/location/places/qmlplaceswrapper.cpp b/examples/location/places/main.cpp
index e3a14346..8c3b64ed 100644
--- a/examples/location/places/qmlplaceswrapper.cpp
+++ b/examples/location/places/main.cpp
@@ -38,12 +38,10 @@
**
****************************************************************************/
-#include <QtCore/QStringList>
#include <QtCore/QTextStream>
#include <QtGui/QGuiApplication>
-#include <QtQml/QQmlEngine>
+#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
-#include <QtQuick/QQuickView>
#include <QtQuick/QQuickItem>
static bool parseArgs(QStringList& args, QVariantMap& parameters)
@@ -95,18 +93,16 @@ int main(int argc, char *argv[])
if (parseArgs(args, parameters))
return 0;
- const QString mainQmlApp = QStringLiteral("qrc:///places.qml");
- QQuickView view;
+ QQmlApplicationEngine engine;
+ engine.addImportPath(QStringLiteral(":/imports"));
+ engine.load(QUrl(QStringLiteral("qrc:///places.qml")));
+ QObject::connect(&engine, SIGNAL(quit()), qApp, SLOT(quit()));
- view.engine()->addImportPath(QStringLiteral(":/imports"));
+ QObject *item = engine.rootObjects().first();
+ Q_ASSERT(item);
- view.rootContext()->setContextProperty(QStringLiteral("pluginParameters"), parameters);
+ QMetaObject::invokeMethod(item, "initializeProviders",
+ Q_ARG(QVariant, QVariant::fromValue(parameters)));
- view.setSource(QUrl(mainQmlApp));
- view.setResizeMode(QQuickView::SizeRootObjectToView);
-
- QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit()));
- view.setGeometry(QRect(100, 100, 360, 640));
- view.show();
return application.exec();
}
diff --git a/examples/location/places/places.pro b/examples/location/places/places.pro
index 5f418e05..baeef405 100644
--- a/examples/location/places/places.pro
+++ b/examples/location/places/places.pro
@@ -2,41 +2,43 @@ TARGET = qml_location_places
TEMPLATE = app
QT += qml quick network positioning location
-SOURCES += qmlplaceswrapper.cpp
+SOURCES += main.cpp
RESOURCES += \
- placeswrapper.qrc
-
-qmlcontent.files += \
- places.qml
-OTHER_FILES += $$qmlcontent.files
-
-qmlcontentplaces.files += \
- content/places/PlacesUtils.js \
- content/places/Group.qml \
- content/places/SearchBox.qml \
- content/places/CategoryDelegate.qml \
- content/places/SearchResultDelegate.qml \
- content/places/PlaceDelegate.qml \
- content/places/RatingView.qml \
- content/places/SearchResultView.qml \
- content/places/PlaceEditorials.qml \
- content/places/EditorialDelegate.qml \
- content/places/EditorialPage.qml \
- content/places/PlaceReviews.qml \
- content/places/ReviewDelegate.qml \
- content/places/ReviewPage.qml \
- content/places/PlaceImages.qml \
- content/places/MapComponent.qml \
- content/places/OptionsDialog.qml \
- content/places/CategoryView.qml
-
-OTHER_FILES += $$qmlcontentplaces.files
-
-include(../common/common.pri)
+ places.qrc
+
+OTHER_FILES += \
+ places.qml \
+ helper.js \
+ items/MainMenu.qml \
+ items/SearchBar.qml \
+ items/MapComponent.qml \
+ forms/Message.qml \
+ forms/MessageForm.ui.qml \
+ forms/SearchCenter.qml \
+ forms/SearchCenterForm.ui.qml \
+ forms/SearchBoundingBox.qml \
+ forms/SearchBoundingBoxForm.ui.qml \
+ forms/SearchBoundingCircle.qml \
+ forms/SearchBoundingCircleForm.ui.qml \
+ forms/PlaceDetails.qml \
+ forms/PlaceDetailsForm.ui.qml \
+ forms/SearchOptions.qml \
+ forms/SearchOptionsForm.ui.qml \
+ views/SuggestionView.qml \
+ views/RatingView.qml \
+ views/CategoryView.qml \
+ views/CategoryDelegate.qml \
+ views/SearchResultDelegate.qml \
+ views/SearchResultView.qml \
+ views/EditorialView.qml \
+ views/EditorialDelegate.qml \
+ views/EditorialPage.qml \
+ views/ReviewView.qml \
+ views/ReviewDelegate.qml \
+ views/ReviewPage.qml \
+ views/ImageView.qml
target.path = $$[QT_INSTALL_EXAMPLES]/location/places
-additional.files = ../common
-additional.path = $$[QT_INSTALL_EXAMPLES]/location/common
-INSTALLS += target additional
+INSTALLS += target
diff --git a/examples/location/places/places.qml b/examples/location/places/places.qml
index 814fcd21..f5586268 100644
--- a/examples/location/places/places.qml
+++ b/examples/location/places/places.qml
@@ -38,234 +38,308 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtPositioning 5.2
-import QtLocation 5.3
-import QtLocation.examples 5.0
-import "content/places"
-
-Item {
- id: page
- width: (parent && parent.width > 0) ? parent.width : 360
- height: (parent && parent.height > 0) ? parent.height : 640
- property variant map
- property variant startLocation
- property variant searchRegion: QtPositioning.circle(startLocation)
+import QtQuick 2.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+import QtPositioning 5.5
+import QtLocation 5.5
+import "items"
+
+ApplicationWindow {
+ id: appWindow
+ property Map map
+ property variant parameters
+ property variant searchLocation: map ? map.center : QtPositioning.coordinate()
+ property variant searchRegion: QtPositioning.circle(searchLocation)
property variant searchRegionItem
+
property Plugin favoritesPlugin
- Binding {
- target: page
- property: "startLocation"
- value: map ? map.center : QtPositioning.coordinate()
- }
+ function getPlugins() {
+ var plugin = Qt.createQmlObject('import QtLocation 5.3; Plugin {}', appWindow);
+ var myArray = new Array;
+ for (var i = 0; i < plugin.availableServiceProviders.length; i++) {
+ var tempPlugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin {name: "' + plugin.availableServiceProviders[i]+ '"}', appWindow)
- Rectangle {
- id: backgroundRect
- anchors.fill: parent
- color: "lightgrey"
- z: 2
+ if (tempPlugin.supportsPlaces() && tempPlugin.supportsMapping() )
+ myArray.push(tempPlugin.name)
+ }
+ myArray.sort()
+ return myArray;
}
- //=====================Menu=====================
- Menu {
- id:mainMenu
- anchors.bottom: parent.bottom
- z: backgroundRect.z + 3
-
- Component.onCompleted: {
- addItem("Provider");
- addItem("Search");
+ function initializeProviders(pluginParameters)
+ {
+ var parameters = new Array()
+ for (var prop in pluginParameters) {
+ var parameter = Qt.createQmlObject('import QtLocation 5.3; PluginParameter{ name: "'+ prop + '"; value: "' + pluginParameters[prop]+'"}',appWindow)
+ parameters.push(parameter)
}
+ appWindow.parameters = parameters
+ var plugins = getPlugins()
+ mainMenu.providerMenu.createMenu(plugins)
+ for (var i = 0; i<plugins.length; i++) {
+ if (plugins[i] === "osm")
+ mainMenu.selectProvider(plugins[i])
+ }
+ }
- onClicked: page.state = page.state == "" ? button : "";
+ function createMap(provider) {
+ var plugin;
+ if (parameters && parameters.length>0)
+ plugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin{ name:"' + provider + '"; parameters: appWindow.parameters}', appWindow)
+ else
+ plugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin{ name:"' + provider + '"}', appWindow)
+
+ if (map)
+ map.destroy();
+ map = mapComponent.createObject(page);
+ map.plugin = plugin;
+ map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2
+ categoryModel.plugin = plugin;
+ categoryModel.update();
+ placeSearchModel.plugin = plugin;
+ suggestionModel.plugin = plugin;
}
- Menu {
- id: providerMenu
- z: backgroundRect.z + 2
- y: page.height
- horizontalOrientation: false
- exclusive: true
-
- Component.onCompleted: {
- var plugins = getPlacesPlugins()
- for (var i = 0; i<plugins.length; i++) {
- addItem(plugins[i]);
-
- // default to osm plugin
- if (plugins[i] === "osm")
- exclusiveButton = plugins[i];
+ title: qsTr("Places")
+ width: 360
+ height: 640
+ visible: true
+ menuBar: mainMenu
+ toolBar: searchBar
+
+ MainMenu {
+ id: mainMenu
+ onSelectProvider: {
+ stackView.pop(page)
+ for (var i = 0; i < providerMenu.items.length; i++) {
+ providerMenu.items[i].checked = providerMenu.items[i].text === providerName
}
- // otherwise default to first
- if (exclusiveButton === "")
- exclusiveButton = plugins[0];
+ createMap(providerName)
+ if (map.error === Map.NoError) {
+ settingsMenu.createMenu(map);
+ } else {
+ settingsMenu.clear();
+ }
+ }
+ onSelectSetting: {
+ stackView.pop({tem:page,immediate: true})
+ switch (setting) {
+ case "searchCenter":
+ stackView.push({ item: Qt.resolvedUrl("forms/SearchCenter.qml") ,
+ properties: { "coordinate": map.center}})
+ stackView.currentItem.changeSearchCenter.connect(stackView.changeSearchCenter)
+ stackView.currentItem.closeForm.connect(stackView.closeForm)
+ break
+ case "searchBoundingBox":
+ stackView.push({ item: Qt.resolvedUrl("forms/SearchBoundingBox.qml") ,
+ properties: { "searchRegion": searchRegion}})
+ stackView.currentItem.changeSearchBoundingBox.connect(stackView.changeSearchBoundingBox)
+ stackView.currentItem.closeForm.connect(stackView.closeForm)
+ break
+ case "searchBoundingCircle":
+ stackView.push({ item: Qt.resolvedUrl("forms/SearchBoundingCircle.qml") ,
+ properties: { "searchRegion": searchRegion}})
+ stackView.currentItem.changeSearchBoundingCircle.connect(stackView.changeSearchBoundingCircle)
+ stackView.currentItem.closeForm.connect(stackView.closeForm)
+ break
+ case "SearchOptions":
+ stackView.push({ item: Qt.resolvedUrl("forms/SearchOptions.qml") ,
+ properties: { "plugin": map.plugin,
+ "model": placeSearchModel}})
+ stackView.currentItem.changeSearchSettings.connect(stackView.changeSearchSettings)
+ stackView.currentItem.closeForm.connect(stackView.closeForm)
+ break
+ default:
+ console.log("Unsupported setting !")
+ }
}
-
- onClicked: page.state = ""
-
- onExclusiveButtonChanged: placesPlugin.name = exclusiveButton;
}
- Menu {
- id: searchMenu
- z: backgroundRect.z + 2
- y: page.height
- horizontalOrientation: false
-
- Component.onCompleted: {
- addItem("Search Center");
- addItem("Search Bounding Box");
- addItem("Search Bounding Circle");
- addItem("Search Options");
+ SearchBar {
+ id: searchBar
+ width: appWindow.width
+ searchBarVisbile: stackView.depth > 1 &&
+ stackView.currentItem &&
+ stackView.currentItem.objectName != "suggestionView" ? false : true
+ onShowCategories: {
+ if (map && map.plugin) {
+ stackView.pop({tem:page,immediate: true})
+ stackView.enterCategory()
+ }
+ }
+ onGoBack: stackView.pop()
+ onSearchTextChanged: {
+ if (searchText.length >= 3) {
+ if (suggestionModel != null) {
+ suggestionModel.searchTerm = searchText;
+ suggestionModel.update();
+ }
+ }
+ }
+ onDoSearch: {
+ if (searchText.length > 0)
+ placeSearchModel.searchForText(searchText);
}
+ onShowMap: stackView.pop(page)
- onClicked: page.state = button
}
- //=====================Dialogs=====================
-
- InputDialog {
- id: searchCenterDialog
- z: backgroundRect.z + 4
-
- title: "Search center"
-
- Behavior on opacity { NumberAnimation { duration: 500 } }
-
- Component.onCompleted: prepareDialog()
-
- function prepareDialog() {
- setModel([
- ["Latitude", searchRegion.center ? String(searchRegion.center.latitude) : ""],
- ["Longitude", searchRegion.center ? String(searchRegion.center.longitude) : ""]
- ]);
+ StackView {
+ id: stackView
+
+ function showMessage(title,message,backPage)
+ {
+ push({ item: Qt.resolvedUrl("forms/Message.qml") ,
+ properties: {
+ "title" : title,
+ "message" : message,
+ "backPage" : backPage
+ }})
+ currentItem.closeForm.connect(closeMessage)
}
- onCancelButtonClicked: page.state = ""
- onGoButtonClicked: {
- var c = QtPositioning.coordinate(parseFloat(dialogModel.get(0).inputText),
- parseFloat(dialogModel.get(1).inputText));
+ function closeMessage(backPage)
+ {
+ pop(backPage)
+ }
- map.center = c;
+ function closeForm()
+ {
+ pop(page)
+ }
- searchRegion = Qt.binding(function() { return QtPositioning.circle(startLocation) });
+ function enterCategory(index)
+ {
+ push({ item: Qt.resolvedUrl("views/CategoryView.qml") ,
+ properties: { "categoryModel": categoryModel,
+ "rootIndex" : index
+ }})
+ currentItem.enterCategory.connect(stackView.enterCategory)
+ currentItem.searchCategory.connect(placeSearchModel.searchForCategory)
+ }
- if (searchRegionItem) {
- map.removeMapItem(searchRegionItem);
- searchRegionItem.destroy();
+ function showSuggestions()
+ {
+ if (currentItem.objectName != "suggestionView") {
+ stackView.pop(page)
+ push({ item: Qt.resolvedUrl("views/SuggestionView.qml") ,
+ properties: { "suggestionModel": suggestionModel }
+ })
+ currentItem.objectName = "suggestionView"
+ currentItem.suggestionSelected.connect(searchBar.showSearch)
+ currentItem.suggestionSelected.connect(placeSearchModel.searchForText)
}
-
- page.state = "";
}
- }
-
- InputDialog {
- id: searchBoxDialog
- z: backgroundRect.z + 4
- title: "Search Bounding Box"
+ function showPlaces()
+ {
+ if (currentItem.objectName != "searchResultView") {
+ stackView.pop({tem:page,immediate: true})
+ push({ item: Qt.resolvedUrl("views/SearchResultView.qml") ,
+ properties: { "placeSearchModel": placeSearchModel }
+ })
+ currentItem.showPlaceDetails.connect(showPlaceDatails)
+ currentItem.showMap.connect(searchBar.showMap)
+ currentItem.objectName = "searchResultView"
+ }
+ }
- Behavior on opacity { NumberAnimation { duration: 500 } }
+ function showPlaceDatails(place, distance)
+ {
+ push({ item: Qt.resolvedUrl("forms/PlaceDetails.qml") ,
+ properties: { "place": place,
+ "distanceToPlace": distance }
+ })
+ currentItem.searchForSimilar.connect(searchForSimilar)
+ currentItem.showReviews.connect(showReviews)
+ currentItem.showEditorials.connect(showEditorials)
+ currentItem.showImages.connect(showImages)
+ }
- Component.onCompleted: prepareDialog()
+ function showEditorials(place)
+ {
+ push({ item: Qt.resolvedUrl("views/EditorialView.qml") ,
+ properties: { "place": place }
+ })
+ currentItem.showEditorial.connect(showEditorial)
+ }
- function prepareDialog() {
- setModel([
- ["Latitude", searchRegion.center ? String(searchRegion.center.latitude) : ""],
- ["Longitude", searchRegion.center ? String(searchRegion.center.longitude) : ""],
- ["Width(deg)", searchRegion.width ? String(searchRegion.width) : "" ],
- ["Height(deg)", searchRegion.height ? String(searchRegion.height) : "" ]
- ]);
+ function showReviews(place)
+ {
+ push({ item: Qt.resolvedUrl("views/ReviewView.qml") ,
+ properties: { "place": place }
+ })
+ currentItem.showReview.connect(showReview)
}
- onCancelButtonClicked: page.state = ""
- onGoButtonClicked: {
- var c = QtPositioning.coordinate(parseFloat(dialogModel.get(0).inputText),
- parseFloat(dialogModel.get(1).inputText));
- var r = QtPositioning.rectangle(c, parseFloat(dialogModel.get(2).inputText),
- parseFloat(dialogModel.get(3).inputText));
+ function showImages(place)
+ {
+ push({ item: Qt.resolvedUrl("views/ImageView.qml") ,
+ properties: { "place": place }
+ })
+ }
- map.center = c;
+ function showEditorial(editorial)
+ {
+ push({ item: Qt.resolvedUrl("views/EditorialPage.qml") ,
+ properties: { "editorial": editorial }
+ })
+ }
- searchRegion = r;
+ function showReview(review)
+ {
+ push({ item: Qt.resolvedUrl("views/ReviewPage.qml") ,
+ properties: { "review": review }
+ })
+ }
+ function changeSearchCenter(coordinate)
+ {
+ stackView.pop(page)
+ map.center = coordinate;
if (searchRegionItem) {
map.removeMapItem(searchRegionItem);
searchRegionItem.destroy();
}
-
- searchRegionItem = Qt.createQmlObject('import QtLocation 5.3; MapRectangle { color: "red"; opacity: 0.4 }', page, "MapRectangle");
- searchRegionItem.topLeft = r.topLeft;
- searchRegionItem.bottomRight = r.bottomRight;
- map.addMapItem(searchRegionItem);
-
- page.state = "";
}
- }
-
- InputDialog {
- id: searchCircleDialog
- z: backgroundRect.z + 4
-
- title: "Search Bounding Circle"
-
- Behavior on opacity { NumberAnimation { duration: 500 } }
-
- Component.onCompleted: prepareDialog()
-
- function prepareDialog() {
- setModel([
- ["Latitude", searchRegion.center ? String(searchRegion.center.latitude) : ""],
- ["Longitude", searchRegion.center ? String(searchRegion.center.longitude) : ""],
- ["Radius(m)", searchRegion.radius ? String(searchRegion.radius) : "" ]
- ]);
- }
-
- onCancelButtonClicked: page.state = ""
- onGoButtonClicked: {
- var c = QtPositioning.coordinate(parseFloat(dialogModel.get(0).inputText),
- parseFloat(dialogModel.get(1).inputText));
- var circle = QtPositioning.circle(c, parseFloat(dialogModel.get(2).inputText));
-
- map.center = c;
-
- searchRegion = circle;
+ function changeSearchBoundingBox(coordinate,widthDeg,heightDeg)
+ {
+ stackView.pop(page)
+ map.center = coordinate
+ searchRegion = QtPositioning.rectangle(map.center, widthDeg, heightDeg)
if (searchRegionItem) {
map.removeMapItem(searchRegionItem);
searchRegionItem.destroy();
}
-
- searchRegionItem = Qt.createQmlObject('import QtLocation 5.3; MapCircle { color: "red"; opacity: 0.4 }', page, "MapRectangle");
- searchRegionItem.center = circle.center;
- searchRegionItem.radius = circle.radius;
+ searchRegionItem = Qt.createQmlObject('import QtLocation 5.3; MapRectangle { color: "#46a2da"; border.color: "#190a33"; border.width: 2; opacity: 0.25 }', page, "MapRectangle");
+ searchRegionItem.topLeft = searchRegion.topLeft;
+ searchRegionItem.bottomRight = searchRegion.bottomRight;
map.addMapItem(searchRegionItem);
-
- page.state = "";
}
- }
-
- OptionsDialog {
- id: optionsDialog
- z: backgroundRect.z + 4
- Behavior on opacity { NumberAnimation { duration: 500 } }
+ function changeSearchBoundingCircle(coordinate,radius)
+ {
+ stackView.pop(page)
+ map.center = coordinate;
+ searchRegion = QtPositioning.circle(coordinate, radius)
- Component.onCompleted: prepareDialog()
-
- function prepareDialog() {
- if (placeSearchModel.favoritesPlugin !== null)
- isFavoritesEnabled = true;
- else
- isFavoritesEnabled = false;
-
- locales = placesPlugin.locales.join(Qt.locale().groupSeparator);
+ if (searchRegionItem) {
+ map.removeMapItem(searchRegionItem);
+ searchRegionItem.destroy();
+ }
+ searchRegionItem = Qt.createQmlObject('import QtLocation 5.3; MapCircle { color: "#46a2da"; border.color: "#190a33"; border.width: 2; opacity: 0.25 }', page, "MapRectangle");
+ searchRegionItem.center = searchRegion.center;
+ searchRegionItem.radius = searchRegion.radius;
+ map.addMapItem(searchRegionItem);
}
- onCancelButtonClicked: page.state = ""
- onGoButtonClicked: {
+ function changeSearchSettings(orderByDistance, orderByName, locales)
+ {
+ stackView.pop(page)
/*if (isFavoritesEnabled) {
if (favoritesPlugin == null)
favoritesPlugin = Qt.createQmlObject('import QtLocation 5.3; Plugin { name: "places_jsondb" }', page);
@@ -279,187 +353,124 @@ Item {
placeSearchModel.relevanceHint = orderByDistance ? PlaceSearchModel.DistanceHint :
orderByName ? PlaceSearchModel.LexicalPlaceNameHint :
PlaceSearchModel.UnspecifiedHint;
- placesPlugin.locales = locales.split(Qt.locale().groupSeparator);
- categoryModel.update();
- page.state = "";
- }
- }
-
- //! [PlaceSearchModel model]
- PlaceSearchModel {
- id: placeSearchModel
-
- plugin: placesPlugin
- searchArea: searchRegion
-
- function searchForCategory(category) {
- searchTerm = "";
- categories = category;
- recommendationId = "";
- searchArea = searchRegion
- limit = -1;
- update();
- }
-
- function searchForText(text) {
- searchTerm = text;
- categories = null;
- recommendationId = "";
- searchArea = searchRegion
- limit = -1;
- update();
+ map.plugin.locales = locales.split(Qt.locale().groupSeparator);
}
- function searchForRecommendations(placeId) {
- searchTerm = "";
- categories = null;
- recommendationId = placeId;
- searchArea = null;
- limit = -1;
- update();
+ //! [PlaceRecommendationModel search]
+ function searchForSimilar(place) {
+ stackView.pop(page)
+ searchBar.showSearch(place.name)
+ placeSearchModel.searchForRecommendations(place.placeId);
}
+ //! [PlaceRecommendationModel search]
- onStatusChanged: {
- switch (status) {
- case PlaceSearchModel.Ready:
- searchResultView.showSearchResults();
- break;
- case PlaceSearchModel.Error:
- console.log(errorString());
- }
- }
- }
- //! [PlaceSearchModel model]
-
- //! [CategoryModel model]
- CategoryModel {
- id: categoryModel
- plugin: placesPlugin
- hierarchical: true
- }
- //! [CategoryModel model]
-
- SearchBox {
- id: searchBox
-
- anchors.top: page.top
- width: parent.width
- expandedHeight: parent.height
- z: backgroundRect.z + 3
- }
-
- Plugin {
- id: placesPlugin
-
- parameters: pluginParametersFromMap(pluginParameters)
- onNameChanged: {
- createMap(placesPlugin);
- categoryModel.update();
- }
- }
-
- Item {
- id: searchResultTab
-
- z: backgroundRect.z + 2
- height: parent.height - searchBox.baseHeight - mainMenu.height
- width: parent.width
- x: 0
- y: mainMenu.height - height + catchImage.width
-
- opacity: 0
-
- property bool open: false
-
- Behavior on y { PropertyAnimation { duration: 300; easing.type: Easing.InOutQuad } }
- Behavior on opacity { PropertyAnimation { duration: 300 } }
+ anchors.fill: parent
+ focus: true
+ initialItem: Item {
+ id: page
+
+ //! [PlaceSearchModel model]
+ PlaceSearchModel {
+ id: placeSearchModel
+ searchArea: searchRegion
+
+ function searchForCategory(category) {
+ searchTerm = "";
+ categories = category;
+ recommendationId = "";
+ searchArea = searchRegion
+ limit = -1;
+ update();
+ }
- Image {
- id: catchImage
+ function searchForText(text) {
+ searchTerm = text;
+ categories = null;
+ recommendationId = "";
+ searchArea = searchRegion
+ limit = -1;
+ update();
+ }
- source: "resources/catch.png"
- rotation: 90
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: (width - height) / 2
+ function searchForRecommendations(placeId) {
+ searchTerm = "";
+ categories = null;
+ recommendationId = placeId;
+ searchArea = null;
+ limit = -1;
+ update();
+ }
- MouseArea {
- anchors.fill: parent
- onClicked: searchResultTab.open = !searchResultTab.open;
+ onStatusChanged: {
+ switch (status) {
+ case PlaceSearchModel.Ready:
+ if (count > 0)
+ stackView.showPlaces()
+ else
+ stackView.showMessage(qsTr("Search Place Error"),qsTr("Place not found !"))
+ break;
+ case PlaceSearchModel.Error:
+ stackView.showMessage(qsTr("Search Place Error"),errorString())
+ break;
+ }
+ }
}
- }
-
- Rectangle {
- id: searchResultTabPage
+ //! [PlaceSearchModel model]
- width: parent.width
- height: parent.height - catchImage.width
- color: "#ECECEC"
- radius: 5
+ //! [PlaceSearchSuggestionModel model]
+ PlaceSearchSuggestionModel {
+ id: suggestionModel
+ searchArea: searchRegion
- SearchResultView {
- id: searchResultView
-
- anchors.fill: parent
- anchors.margins: 10
+ onStatusChanged: {
+ if (status == PlaceSearchSuggestionModel.Ready)
+ stackView.showSuggestions()
+ }
}
- }
+ //! [PlaceSearchSuggestionModel model]
- states: [
- State {
- name: ""
- when: placeSearchModel.count == 0
- PropertyChanges { target: searchResultTab; open: false }
- },
- State {
- name: "Close"
- when: (placeSearchModel.count > 0) && !searchResultTab.open
- PropertyChanges { target: searchResultTab; opacity: 1 }
- },
- State {
- name: "Open"
- when: (placeSearchModel.count > 0) && searchResultTab.open
- PropertyChanges { target: searchResultTab; y: mainMenu.height; opacity: 1 }
+ //! [CategoryModel model]
+ CategoryModel {
+ id: categoryModel
+ hierarchical: true
}
- ]
- }
-
- Component {
- id: mapComponent
-
- MapComponent {
- z: backgroundRect.z + 1
-
- anchors {
- top: searchBox.bottom
- bottom: mainMenu.top
- left: page.left
- right: page.right
- }
-
- MapItemView {
- model: placeSearchModel
- delegate: MapQuickItem {
- coordinate: model.type === PlaceSearchModel.PlaceResult ? place.location.coordinate : QtPositioning.coordinate()
-
- visible: model.type === PlaceSearchModel.PlaceResult
+ //! [CategoryModel model]
+
+ Component {
+ id: mapComponent
+
+ MapComponent {
+ width: page.width
+ height: page.height
+
+ onErrorChanged: {
+ if (map.error != Map.NoError) {
+ var title = qsTr("ProviderError");
+ var message = map.errorString + "<br/><br/><b>" + qsTr("Try to select other provider") + "</b>";
+ if (map.error == Map.MissingRequiredParameterError)
+ message += "<br/>" + qsTr("or see") + " \'mapviewer --help\' "
+ + qsTr("how to pass plugin parameters.");
+ stackView.showMessage(title,message);
+ }
+ }
- anchorPoint.x: image.width * 0.28
- anchorPoint.y: image.height
+ MapItemView {
+ model: placeSearchModel
+ delegate: MapQuickItem {
+ coordinate: model.type === PlaceSearchModel.PlaceResult ? place.location.coordinate : QtPositioning.coordinate()
- sourceItem: Image {
- id: image
+ visible: model.type === PlaceSearchModel.PlaceResult
- source: "resources/marker.png"
+ anchorPoint.x: image.width * 0.28
+ anchorPoint.y: image.height
- MouseArea {
- anchors.fill: parent
- onClicked: {
- searchResultView.showPlaceDetails({
- distance: model.distance,
- place: model.place,
- });
- searchResultTab.state = "Open";
+ sourceItem: Image {
+ id: image
+ source: "resources/marker.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: stackView.showPlaceDatails(model.place,model.distance)
+ }
}
}
}
@@ -468,89 +479,16 @@ Item {
}
}
- function createMap(placesPlugin) {
- var mapPlugin;
- if (placesPlugin.supportsMapping()) {
- mapPlugin = placesPlugin;
- } else {
- mapPlugin = Qt.createQmlObject('import QtLocation 5.3; Plugin { required.mapping: Plugin.AnyMappingFeatures;' +
- 'parameters: pluginParametersFromMap(pluginParameters) }', page);
- }
-
- if (map)
- map.destroy();
- map = mapComponent.createObject(page);
- map.plugin = mapPlugin;
- }
-
- function getPlacesPlugins() {
- var plugin = Qt.createQmlObject('import QtLocation 5.3; Plugin {}', page);
- var myArray = new Array;
- for (var i = 0; i < plugin.availableServiceProviders.length; i++) {
- var tempPlugin = Qt.createQmlObject ('import QtLocation 5.3; Plugin {name: "' + plugin.availableServiceProviders[i]+ '"}', page)
-
- if (tempPlugin.supportsPlaces())
- myArray.push(tempPlugin.name)
- }
-
- return myArray;
+ Rectangle {
+ color: "white"
+ opacity: busyIndicator.running ? 0.8 : 0
+ anchors.fill: parent
+ Behavior on opacity { NumberAnimation{} }
}
-
- function pluginParametersFromMap(pluginParameters) {
- var parameters = new Array()
- for (var prop in pluginParameters){
- var parameter = Qt.createQmlObject('import QtLocation 5.3; PluginParameter{ name: "'+ prop + '"; value: "' + pluginParameters[prop]+'"}',page)
- parameters.push(parameter)
- }
- return parameters
- //createMap(placesPlugin)
+ BusyIndicator {
+ id: busyIndicator
+ anchors.centerIn: parent
+ running: placeSearchModel.status == PlaceSearchModel.Loading ||
+ categoryModel.status === CategoryModel.Loading
}
-
- //=====================States of page=====================
- states: [
- State {
- name: "Provider"
- PropertyChanges { target: providerMenu; y: page.height - providerMenu.height - mainMenu.height }
- },
- State {
- name: "Search"
- PropertyChanges { target: searchMenu; y: page.height - searchMenu.height - mainMenu.height }
- },
- State {
- name: "Search Center"
- PropertyChanges { target: searchCenterDialog; opacity: 1 }
- StateChangeScript { script: searchCenterDialog.prepareDialog() }
- },
- State {
- name: "Search Bounding Box"
- PropertyChanges { target: searchBoxDialog; opacity: 1 }
- StateChangeScript { script: searchBoxDialog.prepareDialog() }
- },
- State {
- name: "Search Bounding Circle"
- PropertyChanges { target: searchCircleDialog; opacity: 1 }
- StateChangeScript { script: searchCircleDialog.prepareDialog() }
- },
- State {
- name: "Search Options"
- PropertyChanges { target: optionsDialog; opacity: 1 }
- StateChangeScript { script: optionsDialog.prepareDialog() }
- }
- ]
-
- //=====================State-transition animations for page=====================
- transitions: [
- Transition {
- to: ""
- NumberAnimation { properties: "opacity,y,x,rotation" ; duration: 500; easing.type: Easing.Linear }
- },
- Transition {
- to: "Provider"
- NumberAnimation { properties: "y" ; duration: 300; easing.type: Easing.Linear }
- },
- Transition {
- to: "Search"
- NumberAnimation { properties: "y" ; duration: 300; easing.type: Easing.Linear }
- }
- ]
}
diff --git a/examples/location/places/places.qrc b/examples/location/places/places.qrc
new file mode 100644
index 00000000..42026a6c
--- /dev/null
+++ b/examples/location/places/places.qrc
@@ -0,0 +1,42 @@
+<RCC>
+ <qresource prefix="/">
+ <file>places.qml</file>
+ <file>helper.js</file>
+ <file>items/MainMenu.qml</file>
+ <file>items/MapComponent.qml</file>
+ <file>items/SearchBar.qml</file>
+ <file>forms/Message.qml</file>
+ <file>forms/MessageForm.ui.qml</file>
+ <file>forms/SearchCenter.qml</file>
+ <file>forms/SearchCenterForm.ui.qml</file>
+ <file>forms/SearchBoundingBox.qml</file>
+ <file>forms/SearchBoundingBoxForm.ui.qml</file>
+ <file>forms/SearchBoundingCircle.qml</file>
+ <file>forms/SearchBoundingCircleForm.ui.qml</file>
+ <file>forms/SearchOptions.qml</file>
+ <file>forms/SearchOptionsForm.ui.qml</file>
+ <file>forms/PlaceDetails.qml</file>
+ <file>forms/PlaceDetailsForm.ui.qml</file>
+ <file>views/SuggestionView.qml</file>
+ <file>views/CategoryDelegate.qml</file>
+ <file>views/CategoryView.qml</file>
+ <file>views/EditorialDelegate.qml</file>
+ <file>views/EditorialPage.qml</file>
+ <file>views/EditorialView.qml</file>
+ <file>views/ImageView.qml</file>
+ <file>views/RatingView.qml</file>
+ <file>views/ReviewDelegate.qml</file>
+ <file>views/ReviewPage.qml</file>
+ <file>views/ReviewView.qml</file>
+ <file>views/SearchResultDelegate.qml</file>
+ <file>views/SearchResultView.qml</file>
+ <file>resources/categories.png</file>
+ <file>resources/left.png</file>
+ <file>resources/marker.png</file>
+ <file>resources/right.png</file>
+ <file>resources/scale.png</file>
+ <file>resources/scale_end.png</file>
+ <file>resources/search.png</file>
+ <file>resources/star.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/location/places/placeswrapper.qrc b/examples/location/places/placeswrapper.qrc
deleted file mode 100644
index 4ce2461c..00000000
--- a/examples/location/places/placeswrapper.qrc
+++ /dev/null
@@ -1,23 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>places.qml</file>
- <file>content/places/CategoryDelegate.qml</file>
- <file>content/places/CategoryView.qml</file>
- <file>content/places/EditorialDelegate.qml</file>
- <file>content/places/EditorialPage.qml</file>
- <file>content/places/Group.qml</file>
- <file>content/places/MapComponent.qml</file>
- <file>content/places/OptionsDialog.qml</file>
- <file>content/places/PlaceDelegate.qml</file>
- <file>content/places/PlaceEditorials.qml</file>
- <file>content/places/PlaceImages.qml</file>
- <file>content/places/PlaceReviews.qml</file>
- <file>content/places/RatingView.qml</file>
- <file>content/places/ReviewDelegate.qml</file>
- <file>content/places/ReviewPage.qml</file>
- <file>content/places/SearchBox.qml</file>
- <file>content/places/SearchResultDelegate.qml</file>
- <file>content/places/SearchResultView.qml</file>
- <file>content/places/PlacesUtils.js</file>
- </qresource>
-</RCC>
diff --git a/examples/location/common/resources/categories.png b/examples/location/places/resources/categories.png
index d1d82c2e..d1d82c2e 100644
--- a/examples/location/common/resources/categories.png
+++ b/examples/location/places/resources/categories.png
Binary files differ
diff --git a/examples/location/common/resources/left.png b/examples/location/places/resources/left.png
index c0efa646..c0efa646 100644
--- a/examples/location/common/resources/left.png
+++ b/examples/location/places/resources/left.png
Binary files differ
diff --git a/examples/location/places/resources/marker.png b/examples/location/places/resources/marker.png
new file mode 100644
index 00000000..d5c698d1
--- /dev/null
+++ b/examples/location/places/resources/marker.png
Binary files differ
diff --git a/examples/location/common/resources/right.png b/examples/location/places/resources/right.png
index db343b07..db343b07 100644
--- a/examples/location/common/resources/right.png
+++ b/examples/location/places/resources/right.png
Binary files differ
diff --git a/examples/location/common/resources/scale.png b/examples/location/places/resources/scale.png
index 6e59ff08..6e59ff08 100644
--- a/examples/location/common/resources/scale.png
+++ b/examples/location/places/resources/scale.png
Binary files differ
diff --git a/examples/location/common/resources/scale_end.png b/examples/location/places/resources/scale_end.png
index 5d3a471b..5d3a471b 100644
--- a/examples/location/common/resources/scale_end.png
+++ b/examples/location/places/resources/scale_end.png
Binary files differ
diff --git a/examples/location/common/resources/search.png b/examples/location/places/resources/search.png
index 6bad5bd7..6bad5bd7 100644
--- a/examples/location/common/resources/search.png
+++ b/examples/location/places/resources/search.png
Binary files differ
diff --git a/examples/location/common/resources/star.png b/examples/location/places/resources/star.png
index 93451147..93451147 100644
--- a/examples/location/common/resources/star.png
+++ b/examples/location/places/resources/star.png
Binary files differ
diff --git a/examples/location/places/content/places/CategoryDelegate.qml b/examples/location/places/views/CategoryDelegate.qml
index e12efd2f..2ac0a339 100644
--- a/examples/location/places/content/places/CategoryDelegate.qml
+++ b/examples/location/places/views/CategoryDelegate.qml
@@ -38,69 +38,68 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
-import QtLocation.examples 5.0
+import QtQuick 2.5
+import QtQuick.Controls 1.4
+import QtLocation 5.5
Item {
id: root
- property bool showChildren: true
-
- signal clicked
- signal arrowClicked
+ property alias text: textItem.text
+ property bool checked: false
+ signal searchCategory()
+ signal showSubcategory()
width: parent.width
- height: textItem.height
+ height: Math.max(icon.height, textItem.height * 2)
- Item {
- id: textItem
+ //! [CategoryModel delegate icon]
+ Image {
+ id: icon
anchors.left: parent.left
- anchors.right: arrow.left
+ anchors.leftMargin: 30
anchors.verticalCenter: parent.verticalCenter
+ source: category.icon.url()
+ }
+ //! [CategoryModel delegate icon]
- 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
+ Rectangle {
+ anchors.fill: parent
+ color: "#44ffffff"
+ visible: mouse.pressed
+ }
- verticalAlignment: Text.AlignVCenter
+ //! [CategoryModel delegate text]
+ Label {
+ id: textItem
+ text: category.name
+ anchors.left: icon.right
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: arrow.left
+ }
+ //! [CategoryModel delegate text]
- text: category.name
- elide: Text.ElideRight
- }
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 15
+ height: 1
+ color: "#46a2da"
+ }
- MouseArea {
- anchors.fill: parent
- onClicked: root.clicked()
- }
- //! [CategoryModel delegate text]
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ onClicked: root.searchCategory()
}
- IconButton {
+ ToolButton {
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()
+ anchors.rightMargin: 15
+ visible: model.hasModelChildren
+ iconSource: "../../resources/right.png"
+ onClicked: root.showSubcategory()
}
- //! [CategoryModel delegate icon]
}
diff --git a/examples/location/common/imports/QtLocation/examples/components/Fader.qml b/examples/location/places/views/CategoryView.qml
index 3babbad7..d476300a 100644
--- a/examples/location/common/imports/QtLocation/examples/components/Fader.qml
+++ b/examples/location/places/views/CategoryView.qml
@@ -38,31 +38,34 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.5
+import QtLocation 5.5
-Rectangle {
- id: fader
- anchors.fill: parent
- opacity: 0.7
- color: "darkgrey"
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: false
- }
- Component.onCompleted: {
- var globalXY
- var root = parent
+//! [CategoryModel view 1]
+ListView {
+ id: root
+ property variant categoryModel
+ property variant rootIndex
+
+ signal searchCategory(variant category)
+ signal enterCategory(variant index)
+//! [CategoryModel view 1]
+ snapMode: ListView.SnapToItem
+
+//! [CategoryModel view 2]
+
+//! [CategoryModel view 2]
- if (root != null) {
- while (root.parent) root = root.parent
- width = root.width; height = root.height;
- globalXY = mapFromItem(root, root.x, root.y);
- } else {
- globalXY = mapFromItem(null, 0, 0);
+//! [CategoryModel view 3]
+ model: VisualDataModel {
+ id: visalDataModel
+ model: root.categoryModel
+ rootIndex: root.rootIndex
+ delegate: CategoryDelegate {
+ onSearchCategory: root.searchCategory(category);
+ onShowSubcategory: root.enterCategory(visalDataModel.modelIndex(index))
}
- x = globalXY.x;
- y = globalXY.y;
}
}
+//! [CategoryModel view 3]
diff --git a/examples/location/places/content/places/EditorialDelegate.qml b/examples/location/places/views/EditorialDelegate.qml
index ef15c171..7d55e02b 100644
--- a/examples/location/places/content/places/EditorialDelegate.qml
+++ b/examples/location/places/views/EditorialDelegate.qml
@@ -38,11 +38,13 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
+import QtQuick 2.5
+import QtLocation 5.5
+import QtQuick.Controls 1.4
Item {
id: root
+ signal showEditorial()
width: parent.width
height: icon.height + 8
@@ -57,11 +59,11 @@ Item {
anchors.left: root.left
anchors.leftMargin: 4
- source: supplier.icon.url(Qt.size(64, 64), Icon.List)
+ source: model.supplier.icon.url(Qt.size(64, 64), Icon.List)
fillMode: Image.PreserveAspectFit
}
- Text {
+ Label {
anchors.top: icon.top
anchors.topMargin: 4
anchors.left: icon.right
@@ -71,7 +73,6 @@ Item {
text: model.title.length > 0 ? model.title : qsTr("Untitled editorial")
font.bold: true
- font.pixelSize: 16
wrapMode: Text.WordWrap
elide: Text.ElideRight
@@ -80,10 +81,6 @@ Item {
MouseArea {
anchors.fill: parent
- onClicked: {
- placeContent.source = "";
- placeContent.data = model;
- placeContent.source = "EditorialPage.qml";
- }
+ onClicked: showEditorial()
}
}
diff --git a/examples/location/places/views/EditorialPage.qml b/examples/location/places/views/EditorialPage.qml
new file mode 100644
index 00000000..42864ef3
--- /dev/null
+++ b/examples/location/places/views/EditorialPage.qml
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** 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.5
+import QtLocation 5.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+
+Item {
+ id: root
+ property variant editorial
+ width: parent.width
+ height: parent.height
+
+ ScrollView {
+ id: scrollView
+ flickableItem.interactive: true
+ anchors.fill: parent
+ anchors.margins: 15
+
+ ColumnLayout {
+ width: scrollView.width - 30
+ spacing: 10
+
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 1
+ color: "#46a2da"
+ }
+
+ Label {
+ text: editorial.title
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+ wrapMode: Text.WordWrap
+ textFormat: Text.RichText
+ }
+
+ Label {
+ text: editorial.text
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+ wrapMode: Text.WordWrap
+ textFormat: Text.RichText
+ }
+
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 1
+ color: "#46a2da"
+ }
+
+ Image {
+ Layout.alignment: Qt.AlignHCenter
+ source: editorial.supplier.icon.url(Qt.size(width, height), Icon.List)
+ }
+
+ Label {
+ text: editorial.supplier.name
+ Layout.alignment: Qt.AlignHCenter
+ wrapMode: Text.WordWrap
+ textFormat: Text.RichText
+ }
+
+ Button {
+ id: button
+ text: qsTr("Open url")
+ Layout.alignment: Qt.AlignHCenter
+ onClicked: {
+ Qt.openUrlExternally(editorial.supplier.url)
+ }
+ }
+ }
+ }
+}
diff --git a/examples/location/common/imports/QtLocation/examples/components/BusyIndicator.qml b/examples/location/places/views/EditorialView.qml
index 9174290d..e7b580ef 100644
--- a/examples/location/common/imports/QtLocation/examples/components/BusyIndicator.qml
+++ b/examples/location/places/views/EditorialView.qml
@@ -38,18 +38,20 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.5
+import QtLocation 5.5
-Image {
- id: root
-
- source: "../../../../resources/busy.png"
-
- RotationAnimation on rotation {
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 500
- running: root.visible
+//! [PlaceEditorialModel view]
+ListView {
+ id:view
+ property Place place
+ signal showEditorial(variant editorial)
+ width: parent.width
+ height: parent.height
+ model: place.editorialModel
+ delegate: EditorialDelegate {
+ onShowEditorial: view.showEditorial(model)
}
}
+//! [PlaceEditorialModel view]
+
diff --git a/examples/location/places/content/places/PlaceImages.qml b/examples/location/places/views/ImageView.qml
index e1afa5a6..a82a9d1d 100644
--- a/examples/location/places/content/places/PlaceImages.qml
+++ b/examples/location/places/views/ImageView.qml
@@ -38,15 +38,15 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
+import QtQuick 2.5
+import QtLocation 5.5
+import QtQuick.Controls 1.4
Item {
id: root
-
- anchors.fill: parent
-
- clip: true
+ property Place place
+ width: parent.width
+ height: parent.height
GridView {
id: gridView
@@ -103,26 +103,28 @@ Item {
Image {
anchors.fill: parent
-
source: url
-
fillMode: Image.PreserveAspectFit
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: root.state = ""
+ }
}
- Text {
- text: supplier.name + "\n" + supplier.url
- width: parent.width
+ Button {
+ id: button
+ text: qsTr("Open url")
anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ Qt.openUrlExternally(supplier.url)
+ }
}
}
-
- MouseArea {
- anchors.fill: parent
- onClicked: root.state = ""
- }
}
- Text {
+ Label {
id: position
width: parent.width
diff --git a/examples/location/places/content/places/RatingView.qml b/examples/location/places/views/RatingView.qml
index 8e6837b7..7751f644 100644
--- a/examples/location/places/content/places/RatingView.qml
+++ b/examples/location/places/views/RatingView.qml
@@ -38,11 +38,11 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.5
Row {
property real rating: 0
- property int size: 32
+ property int size: 0
Repeater {
model: Math.ceil(rating)
diff --git a/examples/location/places/content/places/ReviewDelegate.qml b/examples/location/places/views/ReviewDelegate.qml
index 9aba9269..97991254 100644
--- a/examples/location/places/content/places/ReviewDelegate.qml
+++ b/examples/location/places/views/ReviewDelegate.qml
@@ -38,11 +38,13 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
+import QtQuick 2.5
+import QtLocation 5.5
+import QtQuick.Controls 1.4
Item {
id: root
+ signal showReview()
width: parent.width
height: icon.height + 8
@@ -57,11 +59,11 @@ Item {
anchors.left: root.left
anchors.leftMargin: 4
- source: supplier.icon.url(Qt.size(64, 64), Icon.List)
+ source: model.supplier.icon.url(Qt.size(64, 64), Icon.List)
fillMode: Image.PreserveAspectFit
}
- Text {
+ Label {
anchors.top: icon.top
anchors.topMargin: 4
anchors.left: icon.right
@@ -71,7 +73,6 @@ Item {
text: model.title
font.bold: true
- font.pixelSize: 16
wrapMode: Text.WordWrap
elide: Text.ElideRight
@@ -92,10 +93,6 @@ Item {
MouseArea {
anchors.fill: parent
- onClicked: {
- placeContent.source = "";
- placeContent.data = model;
- placeContent.source = "ReviewPage.qml";
- }
+ onClicked: showReview()
}
}
diff --git a/examples/location/places/content/places/ReviewPage.qml b/examples/location/places/views/ReviewPage.qml
index 606ea2d4..2fdf3523 100644
--- a/examples/location/places/content/places/ReviewPage.qml
+++ b/examples/location/places/views/ReviewPage.qml
@@ -38,66 +38,85 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
+import QtQuick 2.5
+import QtLocation 5.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
Item {
- anchors.fill: parent
+ id: root
+ property variant review
+ width: parent.width
+ height: parent.height
- property variant d: parent ? parent.data : null
-
- Flickable {
+ ScrollView {
+ id: scrollView
+ flickableItem.interactive: true
anchors.fill: parent
+ anchors.margins: 15
- contentHeight: c.height
- contentWidth: width
-
- Column {
- id: c
+ ColumnLayout {
+ width: scrollView.width - 30
+ spacing: 10
- width: parent.width
- clip: true
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 1
+ color: "#46a2da"
+ }
- Text {
- text: d ? d.title : ""
+ Label {
+ text: review.title
width: parent.width
wrapMode: Text.WordWrap
- font.pixelSize: 24
}
- Text {
- text: d ? Qt.formatDateTime(d.dateTime) : ""
+ Label {
+ text: Qt.formatDateTime(review.dateTime)
width: parent.width
- font.pixelSize: 18
+ Layout.alignment: Qt.AlignHCenter
}
RatingView {
size: 16
- rating: d ? d.rating : 0.0
+ rating: review.rating
}
- Text {
- text: d ? d.text : ""
+ Label {
+ text: review.text
width: parent.width
wrapMode: Text.WordWrap
- font.pixelSize: 20
+ Layout.alignment: Qt.AlignHCenter
+ textFormat: Text.RichText
}
- Row {
- Image {
- width: 16
- height: 16
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 1
+ color: "#46a2da"
+ }
- source: d ? d.supplier.icon.url(Qt.size(width, height), Icon.List) : ""
- }
- Text {
- text: d ? d.supplier.name : ""
- font.pixelSize: 16
- }
+ Image {
+ Layout.alignment: Qt.AlignHCenter
+ source: review.supplier.icon.url(Qt.size(width, height), Icon.List)
}
- Text {
- text: d ? d.supplier.url : ""
- font.pixelSize: 16
+
+ Label {
+ text: editorial.supplier.name
+ Layout.alignment: Qt.AlignHCenter
+ wrapMode: Text.WordWrap
+ textFormat: Text.RichText
+ }
+
+ Button {
+ id: button
+ text: qsTr("Open url")
+ Layout.alignment: Qt.AlignHCenter
+ onClicked: {
+ Qt.openUrlExternally(review.supplier.url)
+ }
}
}
}
diff --git a/examples/location/places/content/places/PlaceReviews.qml b/examples/location/places/views/ReviewView.qml
index 214fc98c..095f0947 100644
--- a/examples/location/places/content/places/PlaceReviews.qml
+++ b/examples/location/places/views/ReviewView.qml
@@ -38,21 +38,20 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
-
-Item {
- anchors.fill: parent
-
- clip: true
+import QtQuick 2.5
+import QtLocation 5.5
//! [ReviewModel delegate]
- ListView {
- anchors.fill: parent
-
- model: place.reviewModel
-
- delegate: ReviewDelegate { }
+ListView {
+ id:view
+ property Place place
+ signal showReview(variant review)
+ width: parent.width
+ height: parent.height
+ model: place.reviewModel
+ delegate: ReviewDelegate {
+ onShowReview: view.showReview(model)
}
-//! [ReviewModel delegate]
}
+//! [ReviewModel delegate]
+
diff --git a/examples/location/places/content/places/SearchResultDelegate.qml b/examples/location/places/views/SearchResultDelegate.qml
index dea9043a..5d6cb45c 100644
--- a/examples/location/places/content/places/SearchResultDelegate.qml
+++ b/examples/location/places/views/SearchResultDelegate.qml
@@ -38,35 +38,41 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtLocation 5.3
-import "PlacesUtils.js" as PlacesUtils
+import QtQuick 2.5
+import QtLocation 5.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
+import "../helper.js" as Helper
Item {
id: root
- signal displayPlaceDetails(variant data)
+ signal showPlaceDetails(variant place,variant distance)
signal searchFor(string query)
width: parent.width
- height: childrenRect.height + 20
+ height: childrenRect.height
//! [PlaceSearchModel place delegate]
Component {
id: placeComponent
-
Item {
id: placeRoot
+ width: root.width
+ height: Math.max(icon.height, 3 * placeName.height)
- height: childrenRect.height
- width: parent.width
+ Rectangle {
+ anchors.fill: parent
+ color: "#44ffffff"
+ visible: mouse.pressed
+ }
Rectangle {
anchors.fill: parent
color: "#dbffde"
visible: model.sponsored !== undefined ? model.sponsored : false
- Text {
+ Label {
text: qsTr("Sponsored result")
horizontalAlignment: Text.AlignRight
anchors.right: parent.right
@@ -76,56 +82,53 @@ Item {
}
}
- Row {
+ GridLayout {
+ rows: 2
+ columns: 2
+ anchors.fill: parent
+ anchors.leftMargin: 30
+ flow: GridLayout.TopToBottom
+
Image {
+ // anchors.verticalCenter: parent.verticalCenter
+ id:icon
source: place.favorite ? "../../resources/star.png" : place.icon.url()
+ Layout.rowSpan: 2
}
- Column {
- anchors.verticalCenter: parent.verticalCenter
- Text {
- id: placeName
- text: place.favorite ? place.favorite.name : place.name
- }
+ Label {
+ id: placeName
+ text: place.favorite ? place.favorite.name : place.name
+ Layout.fillWidth: true
+ }
- Text {
- id: distanceText
- font.italic: true
- text: PlacesUtils.prettyDistance(distance)
- }
+ Label {
+ id: distanceText
+ font.italic: true
+ text: Helper.formatDistance(distance)
+ Layout.fillWidth: true
}
}
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 15
+ height: 1
+ color: "#46a2da"
+ }
+
MouseArea {
+ id: mouse
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,
- });
+ root.showPlaceDetails(model.place, model.distance);
}
}
}
-
- states: [
- State {
- name: ""
- },
- State {
- name: "Pressed"
- PropertyChanges { target: placeName; color: "#1C94FC"}
- PropertyChanges { target: distanceText; color: "#1C94FC"}
- }
- ]
}
}
//! [PlaceSearchModel place delegate]
@@ -136,40 +139,42 @@ Item {
Item {
id: proposedSearchRoot
- height: childrenRect.height
- width: parent.width
+ width: root.width
+ height: Math.max(icon.height, 2 * proposedSearchTitle.height)
+
+ Rectangle {
+ anchors.fill: parent
+ color: "#11ffffff"
+ visible: mouse.pressed
+ }
+
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 30
- Row {
Image {
source: icon.url()
}
- Text {
+ Label {
id: proposedSearchTitle
anchors.verticalCenter: parent.verticalCenter
text: "Search for " + title
}
}
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 15
+ height: 1
+ color: "#46a2da"
+ }
+
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"}
- }
- ]
}
}
diff --git a/examples/location/common/imports/QtLocation/examples/dialogs/InputDialog.qml b/examples/location/places/views/SearchResultView.qml
index 272b8848..c5151f30 100644
--- a/examples/location/common/imports/QtLocation/examples/dialogs/InputDialog.qml
+++ b/examples/location/places/views/SearchResultView.qml
@@ -38,57 +38,54 @@
**
****************************************************************************/
-import QtQuick 2.0
-import "../components"
+import QtQuick 2.5
+import QtLocation 5.5
+import QtQuick.Controls 1.4
+import QtQuick.Layouts 1.2
-Dialog {
- id: dialog
+//! [PlaceSearchModel place list]
+ListView {
+ id: searchView
+ width: parent.width
+ height: parent.height
- property alias dialogModel: dialogModel
- property alias length: dialogModel.count
+ property variant placeSearchModel
+ signal showPlaceDetails(variant place, variant distance)
+ signal showMap()
- property int listItemHeight: 21
-
- onClearButtonClicked: {
- for (var i = 0; i < length; ++i)
- dialogModel.set(i, { "inputText": "" });
+ model: placeSearchModel
+ delegate: SearchResultDelegate {
+ onShowPlaceDetails: searchView.showPlaceDetails(place, distance)
+ onSearchFor: placeSearchModel.searchForText(query);
}
- item: ListView {
- id: listview
+ footer:
- model: dialogModel
- delegate: listDelegate
- spacing: gap/2
- clip: true
- snapMode: ListView.SnapToItem
- implicitHeight: (listItemHeight + gap/2)*length + gap/2
- interactive: height < implicitHeight
+ RowLayout {
width: parent.width
- }
- function setModel(objects) {
- dialogModel.clear();
- for (var i = 0; i < objects.length; ++i) {
- dialogModel.append({ "labelText": objects[i][0], "inputText": objects[i][1] });
+ Button {
+ text: qsTr("Previous")
+ enabled: placeSearchModel.previousPagesAvailable
+ onClicked: placeSearchModel.previousPage()
+ Layout.alignment: Qt.AlignHCenter
}
- }
- ListModel {
- id: dialogModel
- }
-
- Component {
- id: listDelegate
-
- TextWithLabel {
- id: textWithLabel
- label: labelText
- text: inputText
- width: parent ? parent.width : 0
- labelWidth: 95
+ Button {
+ text: qsTr("Clear")
+ onClicked: {
+ placeSearchModel.reset()
+ showMap()
+ }
+ Layout.alignment: Qt.AlignHCenter
+ }
- onTextChanged: dialogModel.set(index, {"inputText": text})
+ Button {
+ text: qsTr("Next")
+ enabled: placeSearchModel.nextPagesAvailable
+ onClicked: placeSearchModel.nextPage()
+ Layout.alignment: Qt.AlignHCenter
}
}
}
+//! [PlaceSearchModel place list]
diff --git a/examples/location/places/content/places/Group.qml b/examples/location/places/views/SuggestionView.qml
index 872d45bf..4ae94495 100644
--- a/examples/location/places/content/places/Group.qml
+++ b/examples/location/places/views/SuggestionView.qml
@@ -38,30 +38,30 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.5
+import QtQuick.Controls 1.4
-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
+//! [PlaceSearchSuggestionModel view 1]
+ListView {
+ id: suggestionView
+ property variant suggestionModel
+ signal suggestionSelected(string text)
+//! [PlaceSearchSuggestionModel view 1]
+ snapMode: ListView.SnapToItem
+//! [PlaceSearchSuggestionModel view 2]
+ model: suggestionModel
+ delegate: Item {
width: parent.width
- height: 1
- radius: 1
- border.width: 1
- border.color: "#808080"
- anchors.top: heading.bottom
- anchors.topMargin: 3
- anchors.horizontalCenter: parent.horizontalCenter
+ height: label.height * 1.5
+ Label {
+ id: label
+ text: suggestion
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: suggestionSelected(suggestion)
+ }
}
}
+//! [PlaceSearchSuggestionModel view 2]
+