summaryrefslogtreecommitdiffstats
path: root/examples/declarative/modelviews/webview/googleMaps.qml
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-17 05:15:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-17 05:15:57 (GMT)
commitf60eeb5c165d5b9e5998edae7785cc893a613bca (patch)
tree13997c6ce889b1e51dd159c016437503a094a7e5 /examples/declarative/modelviews/webview/googleMaps.qml
parentbdbe09ad2c01ae11d10511b51f8d7a3dfb27b17c (diff)
parent7a738662838763e4828c6ac8957a2823b095f566 (diff)
downloadQt-f60eeb5c165d5b9e5998edae7785cc893a613bca.zip
Qt-f60eeb5c165d5b9e5998edae7785cc893a613bca.tar.gz
Qt-f60eeb5c165d5b9e5998edae7785cc893a613bca.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Focus should be applied to focus scopes all the way up the chain, not Add focus docs snippets Fix doc for status, add Image::onLoaded. Don't crash due to recursive positioning. ListModel::get() shouldn't print warnings for invalid indices since it Add \brief to TextInput Add missing .pro Restructure the examples. They are now organized into various graphicsWidgets doc example was previously removed Doc fix Add a "priority" property to Keys and KeyNavigation
Diffstat (limited to 'examples/declarative/modelviews/webview/googleMaps.qml')
-rw-r--r--examples/declarative/modelviews/webview/googleMaps.qml43
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/declarative/modelviews/webview/googleMaps.qml b/examples/declarative/modelviews/webview/googleMaps.qml
new file mode 100644
index 0000000..5506012
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googleMaps.qml
@@ -0,0 +1,43 @@
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import Qt 4.7
+import org.webkit 1.0
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+
+ Rectangle {
+ x: 70
+ width: input.width + 20
+ height: input.height + 4
+ anchors.bottom: parent.bottom; anchors.bottomMargin: 5
+ radius: 5
+ opacity: map.status == "Ready" ? 1 : 0
+
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+
+ Text {
+ id: loading
+ anchors.centerIn: parent
+ text: map.status == "Error" ? "Error" : "Loading"
+ opacity: map.status == "Ready" ? 0 : 1
+ font.pixelSize: 30
+
+ Behavior on opacity { NumberAnimation{} }
+ }
+}