aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/accelbubble
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2015-06-29 14:49:40 +0200
committerLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2015-06-30 07:24:58 +0000
commitb9b1f89ea9cad6dce4dfec051ae30e6458fde9dc (patch)
tree126cbcbb95126c40e38fd136daf582c0b02b43a6 /doc/examples/accelbubble
parentccb930e29246e9fd4b56bebcb9e1b9ee29e0ee94 (diff)
Doc: update the mobile application tutorial
Update text to match the template and UI. Use the \example command instead of \page to have qdoc generate HTML files from the example files. This requires also adding the .pro file. Add an SVG image to the sources and link to it from the text. Change-Id: Ib90798386ee082c9ea2a405b33a4f2a5996a9d2a Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Diffstat (limited to 'doc/examples/accelbubble')
-rw-r--r--doc/examples/accelbubble/Bluebubble.svg10
-rw-r--r--doc/examples/accelbubble/accelbubble.pro14
-rw-r--r--doc/examples/accelbubble/main.qml32
3 files changed, 40 insertions, 16 deletions
diff --git a/doc/examples/accelbubble/Bluebubble.svg b/doc/examples/accelbubble/Bluebubble.svg
new file mode 100644
index 0000000000..d9c406c478
--- /dev/null
+++ b/doc/examples/accelbubble/Bluebubble.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny">
+ <defs>
+ <radialGradient id="grad1" cx="0.5" cy="0.7" r="0.7" fx="0.5" fy="0.4">
+ <stop offset="0" style="stop-color:rgb(255,255,255)" />
+ <stop offset="1.5" style="stop-color:rgb(0,102,153)" />
+ </radialGradient>
+ </defs>
+ <circle cx="100" cy="80" r="42" fill="url(#grad1)"/>
+</svg>
diff --git a/doc/examples/accelbubble/accelbubble.pro b/doc/examples/accelbubble/accelbubble.pro
new file mode 100644
index 0000000000..8dcac29df2
--- /dev/null
+++ b/doc/examples/accelbubble/accelbubble.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+
+QT += qml quick widgets
+
+SOURCES += main.cpp
+
+RESOURCES += qml.qrc
+
+# Additional import path used to resolve QML modules in Qt Creator's code model
+QML_IMPORT_PATH =
+
+# Default rules for deployment.
+include(deployment.pri)
+
diff --git a/doc/examples/accelbubble/main.qml b/doc/examples/accelbubble/main.qml
index 10d7aa9908..02cc2f653d 100644
--- a/doc/examples/accelbubble/main.qml
+++ b/doc/examples/accelbubble/main.qml
@@ -35,8 +35,8 @@
**
**************************************************************************/
-import QtQuick 2.2
-import QtQuick.Controls 1.1
+import QtQuick 2.5
+import QtQuick.Controls 1.4
import QtSensors 5.0
@@ -47,6 +47,20 @@ ApplicationWindow {
height: 480
visible: true
+ menuBar: MenuBar {
+ Menu {
+ title: qsTr("File")
+ MenuItem {
+ text: qsTr("&Open")
+ onTriggered: console.log("Open action triggered");
+ }
+ MenuItem {
+ text: qsTr("Exit")
+ onTriggered: Qt.quit();
+ }
+ }
+ }
+
Image {
id: bubble
source: "Bluebubble.svg"
@@ -105,18 +119,4 @@ ApplicationWindow {
function calcRoll(x, y, z) {
return -(Math.atan(x / Math.sqrt(y * y + z * z)) * 57.2957795);
}
-
- menuBar: MenuBar {
- Menu {
- title: qsTr("File")
- MenuItem {
- text: qsTr("&Open")
- onTriggered: console.log("Open action triggered");
- }
- MenuItem {
- text: qsTr("Exit")
- onTriggered: Qt.quit();
- }
- }
- }
}