summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2010-11-23 11:26:54 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2010-11-23 11:26:54 (GMT)
commit802498fcd43558a10bb7477d3957cdd27fd8ec09 (patch)
treec40ddd859b032ffa7ed9c6df1173312c0bb1947d /examples
parent901fee7e610ec53f744416aeeca89c4605923120 (diff)
parent538e7b8ddf45936bb274ed3230b591b3459edfa7 (diff)
downloadQt-802498fcd43558a10bb7477d3957cdd27fd8ec09.zip
Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.tar.gz
Qt-802498fcd43558a10bb7477d3957cdd27fd8ec09.tar.bz2
Merge remote branch 'qt/master' into file-engine-refactor
Conflicts: demos/declarative/minehunt/minehunt.pro src/corelib/io/io.pri src/corelib/io/qfsfileengine.cpp src/corelib/io/qfsfileengine_unix.cpp src/corelib/io/qfsfileengine_win.cpp src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtDeclarativeu.def src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtDeclarativeu.def src/s60installs/eabi/QtGuiu.def tests/auto/qapplication/test/test.pro tests/auto/qaudioinput/qaudioinput.pro tests/auto/qaudiooutput/qaudiooutput.pro tests/auto/qchar/qchar.pro tests/auto/qdiriterator/qdiriterator.pro tests/auto/qsound/qsound.pro
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/animation/behaviors/wigglytext.qml108
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.pro2
-rw-r--r--examples/declarative/cppextensions/plugins/README2
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.pro2
-rw-r--r--examples/declarative/i18n/i18n.qml3
-rw-r--r--examples/declarative/modelviews/listview/highlightranges.qml20
-rw-r--r--examples/declarative/positioners/positioners.qmlproject.user41
-rw-r--r--examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml34
-rwxr-xr-xexamples/declarative/tutorials/samegame/samegame4/content/samegame.js2
-rw-r--r--examples/desktop/systray/systray.pro4
-rw-r--r--examples/draganddrop/puzzle/puzzle.pro4
-rw-r--r--examples/multimedia/audiodevices/audiodevices.h4
-rw-r--r--examples/multimedia/audioinput/audioinput.h5
-rw-r--r--examples/multimedia/audiooutput/audiooutput.h5
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp22
-rw-r--r--examples/network/bearermonitor/bearermonitor.h4
-rw-r--r--examples/network/bearermonitor/bearermonitor.pro7
-rw-r--r--examples/network/bearermonitor/bearermonitor_maemo.ui601
-rw-r--r--examples/network/bearermonitor/main.cpp9
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp4
-rw-r--r--examples/network/bearermonitor/sessionwidget.h5
-rw-r--r--examples/painting/svgviewer/svgviewer.pro4
-rw-r--r--examples/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/richtext/textobject/textobject.pro2
-rw-r--r--examples/script/context2d/context2d.pro2
-rw-r--r--examples/symbianpkgrules.pri5
-rw-r--r--examples/tools/undoframework/mainwindow.cpp2
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro (renamed from examples/tutorials/gettingStarted/gsQml/filedialog/cppPlugins.pro)0
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml55
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml97
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml76
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml91
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml73
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.pngbin0 -> 1670 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.pngbin0 -> 6177 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.pngbin0 -> 6062 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.pngbin0 -> 1055 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml99
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml77
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml92
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml140
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.pngbin0 -> 6079 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml99
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml77
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml92
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml140
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml80
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml68
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.pngbin0 -> 59345 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml109
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml81
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml96
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml146
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml59
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml80
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml146
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.pngbin0 -> 63629 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml127
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml109
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml110
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml170
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml232
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml148
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml86
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir13
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp57
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h57
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp219
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h108
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp56
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h67
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro17
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir1
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.pngbin0 -> 65123 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.pngbin0 -> 21367 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.pngbin0 -> 76693 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject18
-rw-r--r--examples/tutorials/gettingStarted/gsQml/texteditor.pro4
-rw-r--r--examples/webkit/imageanalyzer/README20
-rw-r--r--examples/webkit/imageanalyzer/imageanalyzer.cpp222
-rw-r--r--examples/webkit/imageanalyzer/imageanalyzer.h103
-rw-r--r--examples/webkit/imageanalyzer/imageanalyzer.pro14
-rw-r--r--examples/webkit/imageanalyzer/main.cpp53
-rw-r--r--examples/webkit/imageanalyzer/mainwindow.cpp80
-rw-r--r--examples/webkit/imageanalyzer/mainwindow.h68
-rw-r--r--examples/webkit/imageanalyzer/resources/imageanalyzer.qrc10
-rw-r--r--examples/webkit/imageanalyzer/resources/images/README2
-rw-r--r--examples/webkit/imageanalyzer/resources/images/bellaCoola.jpgbin0 -> 129886 bytes
-rw-r--r--examples/webkit/imageanalyzer/resources/images/flower.jpgbin0 -> 67126 bytes
-rw-r--r--examples/webkit/imageanalyzer/resources/images/mtRainier.jpgbin0 -> 104090 bytes
-rw-r--r--examples/webkit/imageanalyzer/resources/images/seaShell.jpgbin0 -> 82690 bytes
-rw-r--r--examples/webkit/imageanalyzer/resources/images/trees.jpgbin0 -> 98630 bytes
-rw-r--r--examples/webkit/imageanalyzer/resources/index.html133
-rw-r--r--examples/webkit/webkit.pro1
-rw-r--r--examples/widgets/icons/icons.pro2
-rw-r--r--examples/widgets/movie/movie.pro2
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro2
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro2
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro4
106 files changed, 4974 insertions, 385 deletions
diff --git a/examples/declarative/animation/behaviors/wigglytext.qml b/examples/declarative/animation/behaviors/wigglytext.qml
new file mode 100644
index 0000000..6cd93ab
--- /dev/null
+++ b/examples/declarative/animation/behaviors/wigglytext.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Drag this text..."
+ property bool animated: true
+
+ width: 640; height: 480; color: "#474747"; focus: true
+
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Delete || event.key == Qt.Key_Backspace)
+ container.remove()
+ else if (event.text != "") {
+ container.append(event.text)
+ }
+ }
+
+ function append(text) {
+ container.animated = false
+ var lastLetter = container.children[container.children.length - 1]
+ var newLetter = letterComponent.createObject(container)
+ newLetter.text = text
+ newLetter.follow = lastLetter
+ container.animated = true
+ }
+
+ function remove() {
+ if (container.children.length)
+ container.children[container.children.length - 1].destroy()
+ }
+
+ function doLayout() {
+ var follow = null
+ for (var i = 0; i < container.text.length; ++i) {
+ var newLetter = letterComponent.createObject(container)
+ newLetter.text = container.text[i]
+ newLetter.follow = follow
+ follow = newLetter
+ }
+ }
+
+ Component {
+ id: letterComponent
+ Text {
+ id: letter
+ property variant follow
+
+ x: follow ? follow.x + follow.width : container.width / 3
+ y: follow ? follow.y : container.height / 2
+
+ font.pixelSize: 40; font.bold: true
+ color: "#999999"; styleColor: "#222222"; style: Text.Raised
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: letter; drag.axis: Drag.XandYAxis
+ onPressed: letter.color = "#dddddd"
+ onReleased: letter.color = "#999999"
+ }
+
+ Behavior on x { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
+ Behavior on y { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
+ }
+ }
+
+ Component.onCompleted: doLayout()
+}
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
index 9797a3f..f700f0b 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
@@ -22,7 +22,7 @@ symbian:{
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
- importFiles.sources = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir
+ importFiles.files = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir
importFiles.path = ImageProviderCore
DEPLOYMENT += importFiles
}
diff --git a/examples/declarative/cppextensions/plugins/README b/examples/declarative/cppextensions/plugins/README
index fe519f8..95e0eea 100644
--- a/examples/declarative/cppextensions/plugins/README
+++ b/examples/declarative/cppextensions/plugins/README
@@ -5,5 +5,5 @@ by a C++ plugin (providing the "Time" type), and by QML files (providing the
To run:
make install
- qml -I . plugins.qml
+ qmlviewer -I . plugins.qml
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
index 3353a8d..d92e072 100644
--- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -17,7 +17,7 @@ symbian:{
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
- importFiles.sources = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir
+ importFiles.files = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir
importFiles.path = QWidgets
DEPLOYMENT += importFiles
diff --git a/examples/declarative/i18n/i18n.qml b/examples/declarative/i18n/i18n.qml
index 8dac88d..219deda 100644
--- a/examples/declarative/i18n/i18n.qml
+++ b/examples/declarative/i18n/i18n.qml
@@ -65,7 +65,8 @@ Rectangle {
anchors.fill: parent; spacing: 20
Text {
- text: "If a translation is available for the system language (eg. French) then the string below will translated (eg. 'Bonjour'). Otherwise it will show 'Hello'."
+ text: "If a translation is available for the system language (eg. French) then the
+ string below will translated (eg. 'Bonjour'). Otherwise it will show 'Hello'."
width: parent.width; wrapMode: Text.WordWrap
}
diff --git a/examples/declarative/modelviews/listview/highlightranges.qml b/examples/declarative/modelviews/listview/highlightranges.qml
index 2716ee5..58d37a3 100644
--- a/examples/declarative/modelviews/listview/highlightranges.qml
+++ b/examples/declarative/modelviews/listview/highlightranges.qml
@@ -42,15 +42,14 @@ import QtQuick 1.0
import "content"
Rectangle {
+ id: root
+ property int current: 0
width: 600; height: 300
// This example shows the same model in three different ListView items,
// with different highlight ranges. The highlight ranges are set by the
// preferredHighlightBegin and preferredHighlightEnd properties in ListView.
//
- // The second and third ListViews set their currentIndex to be the
- // same as the first. The first ListView is given keyboard focus.
- //
// The first ListView does not set a highlight range, so its currentItem
// can move freely within the visible area. If it moves outside the
// visible area, the view is automatically scrolled to keep the current
@@ -66,9 +65,10 @@ Rectangle {
// forces the current item to change when the view is flicked,
// since the highlight is unable to move.
//
- // Note that the first ListView sets its currentIndex to be equal to
- // the third ListView's currentIndex. By flicking the third ListView with
- // the mouse, the current index of the first ListView will be changed.
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
ListView {
id: list1
@@ -77,7 +77,8 @@ Rectangle {
delegate: petDelegate
highlight: Rectangle { color: "lightsteelblue" }
- currentIndex: list3.currentIndex
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
focus: true
}
@@ -89,7 +90,7 @@ Rectangle {
delegate: petDelegate
highlight: Rectangle { color: "yellow" }
- currentIndex: list1.currentIndex
+ currentIndex: root.current
preferredHighlightBegin: 80; preferredHighlightEnd: 220
highlightRangeMode: ListView.ApplyRange
}
@@ -102,7 +103,8 @@ Rectangle {
delegate: petDelegate
highlight: Rectangle { color: "yellow" }
- currentIndex: list1.currentIndex
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
preferredHighlightBegin: 125; preferredHighlightEnd: 125
highlightRangeMode: ListView.StrictlyEnforceRange
}
diff --git a/examples/declarative/positioners/positioners.qmlproject.user b/examples/declarative/positioners/positioners.qmlproject.user
deleted file mode 100644
index 593479d..0000000
--- a/examples/declarative/positioners/positioners.qmlproject.user
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE QtCreatorProject>
-<qtcreator>
- <data>
- <variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">0</value>
- </data>
- <data>
- <variable>ProjectExplorer.Project.EditorSettings</variable>
- <valuemap type="QVariantMap">
- <value key="EditorConfiguration.Codec" type="QByteArray">UTF-8</value>
- </valuemap>
- </data>
- <data>
- <variable>ProjectExplorer.Project.Target.0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Runtime</value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlTarget</value>
- <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">-1</value>
- <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
- <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">0</value>
- <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
- <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Runtime</value>
- <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlRunConfiguration</value>
- <value key="QmlProjectManager.QmlRunConfiguration.DebugServerAddress" type="QString">127.0.0.1</value>
- <value key="QmlProjectManager.QmlRunConfiguration.DebugServerPort" type="int">3768</value>
- <value key="QmlProjectManager.QmlRunConfiguration.MainScript" type="QString">positioners.qml</value>
- <value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewer" type="QString"></value>
- <value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments" type="QString"></value>
- </valuemap>
- <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
- </valuemap>
- </data>
- <data>
- <variable>ProjectExplorer.Project.TargetCount</variable>
- <value type="int">1</value>
- </data>
- <data>
- <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
- <value type="int">4</value>
- </data>
-</qtcreator>
diff --git a/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml
index 4c1ad51..c60f2df 100644
--- a/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml
+++ b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml
@@ -55,22 +55,6 @@ Rectangle {
source: "content/pics/board.png"
}
- Text {
- id: messageDisplay
- anchors.centerIn: parent
- color: "blue"
- style: Text.Outline; styleColor: "white"
- font.pixelSize: 50; font.bold: true
- visible: false
-
- Timer {
- running: messageDisplay.visible
- onTriggered: {
- messageDisplay.visible = false;
- Logic.restartGame();
- }
- }
- }
Column {
id: display
@@ -118,4 +102,22 @@ Rectangle {
}
}
}
+
+
+ Text {
+ id: messageDisplay
+ anchors.centerIn: parent
+ color: "blue"
+ style: Text.Outline; styleColor: "white"
+ font.pixelSize: 50; font.bold: true
+ visible: false
+
+ Timer {
+ running: messageDisplay.visible
+ onTriggered: {
+ messageDisplay.visible = false;
+ Logic.restartGame();
+ }
+ }
+ }
}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
index 79ff0c1..ccc3f9d 100755
--- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
@@ -145,7 +145,7 @@ function shuffleDown() {
obj = board[index(column, row)];
if (obj == null)
continue;
- obj.x = (fallDist - column) * gameCanvas.blockSize;
+ obj.x = (column - fallDist) * gameCanvas.blockSize;
board[index(column - fallDist, row)] = obj;
board[index(column, row)] = null;
}
diff --git a/examples/desktop/systray/systray.pro b/examples/desktop/systray/systray.pro
index 9b25916..710452b 100644
--- a/examples/desktop/systray/systray.pro
+++ b/examples/desktop/systray/systray.pro
@@ -14,10 +14,10 @@ symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince* {
CONFIG(debug, release|debug) {
- addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvgd4.dll
+ addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qsvgd4.dll
}
CONFIG(release, release|debug) {
- addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvg4.dll
+ addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qsvg4.dll
}
addPlugins.path = imageformats
DEPLOYMENT += addPlugins
diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro
index ec88f7a..c0400d8 100644
--- a/examples/draganddrop/puzzle/puzzle.pro
+++ b/examples/draganddrop/puzzle/puzzle.pro
@@ -18,12 +18,12 @@ INSTALLS += target sources
symbian:{
TARGET.UID3 = 0xA000CF65
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
- addFile.sources = example.jpg
+ addFile.files = example.jpg
addFile.path = .
DEPLOYMENT += addFile
}
wince*: {
- addFile.sources = example.jpg
+ addFile.files = example.jpg
addFile.path = .
DEPLOYMENT += addFile
}
diff --git a/examples/multimedia/audiodevices/audiodevices.h b/examples/multimedia/audiodevices/audiodevices.h
index 3b8f074..4a0f74c 100644
--- a/examples/multimedia/audiodevices/audiodevices.h
+++ b/examples/multimedia/audiodevices/audiodevices.h
@@ -38,6 +38,8 @@
**
****************************************************************************/
+#ifndef AUDIODEVICES_H
+#define AUDIODEVICES_H
#include <QObject>
#include <QMainWindow>
@@ -77,3 +79,5 @@ private slots:
};
+#endif
+
diff --git a/examples/multimedia/audioinput/audioinput.h b/examples/multimedia/audioinput/audioinput.h
index 2f4b206..c198304 100644
--- a/examples/multimedia/audioinput/audioinput.h
+++ b/examples/multimedia/audioinput/audioinput.h
@@ -38,6 +38,9 @@
**
****************************************************************************/
+#ifndef AUDIOINPUT_H
+#define AUDIOINPUT_H
+
#include <QPixmap>
#include <QWidget>
#include <QObject>
@@ -132,3 +135,5 @@ private:
static const QString ResumeLabel;
};
+#endif
+
diff --git a/examples/multimedia/audiooutput/audiooutput.h b/examples/multimedia/audiooutput/audiooutput.h
index 004ca49..2f4aa64 100644
--- a/examples/multimedia/audiooutput/audiooutput.h
+++ b/examples/multimedia/audiooutput/audiooutput.h
@@ -38,6 +38,9 @@
**
****************************************************************************/
+#ifndef AUDIOOUTPUT_H
+#define AUDIOOUTPUT_H
+
#include <math.h>
#include <QObject>
@@ -115,3 +118,5 @@ private slots:
void deviceChanged(int index);
};
+#endif
+
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 2c976ff..75ffb01 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -41,8 +41,8 @@
#include "bearermonitor.h"
#include "sessionwidget.h"
-#include <QDebug>
-#include <QMessageBox>
+#include <QtCore/QDebug>
+
#ifdef Q_OS_WIN
#include <winsock2.h>
#undef interface
@@ -56,20 +56,18 @@ BearerMonitor::BearerMonitor(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+#ifdef MAEMO_UI
newSessionButton->hide();
deleteSessionButton->hide();
#else
delete tabWidget->currentWidget();
sessionGroup->hide();
#endif
-#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI)
setWindowState(Qt::WindowMaximized);
#endif
updateConfigurations();
-#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6)
onlineStateChanged(!manager.allConfigurations(QNetworkConfiguration::Active).isEmpty());
-#endif
QNetworkConfiguration defaultConfiguration = manager.defaultConfiguration();
for (int i = 0; i < treeWidget->topLevelItemCount(); ++i) {
QTreeWidgetItem *item = treeWidget->topLevelItem(i);
@@ -104,7 +102,7 @@ BearerMonitor::BearerMonitor(QWidget *parent)
connect(newSessionButton, SIGNAL(clicked()),
this, SLOT(createNewSession()));
-#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6)
+#ifndef MAEMO_UI
connect(deleteSessionButton, SIGNAL(clicked()),
this, SLOT(deleteSession()));
#endif
@@ -257,15 +255,9 @@ void BearerMonitor::updateConfigurations()
void BearerMonitor::onlineStateChanged(bool isOnline)
{
if (isOnline)
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
- QMessageBox::information(this, "Connection state changed", "Online", QMessageBox::Close);
- else
- QMessageBox::information(this, "Connection state changed", "Offline", QMessageBox::Close);
-#else
onlineState->setText(tr("Online"));
else
onlineState->setText(tr("Offline"));
-#endif
}
#ifdef Q_OS_WIN
@@ -393,7 +385,7 @@ void BearerMonitor::createSessionFor(QTreeWidgetItem *item)
tabWidget->addTab(session, conf.name());
-#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6)
+#ifndef MAEMO_UI
sessionGroup->show();
#endif
@@ -408,7 +400,7 @@ void BearerMonitor::createNewSession()
createSessionFor(item);
}
-#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6)
+#ifndef MAEMO_UI
void BearerMonitor::deleteSession()
{
SessionWidget *session = qobject_cast<SessionWidget *>(tabWidget->currentWidget());
diff --git a/examples/network/bearermonitor/bearermonitor.h b/examples/network/bearermonitor/bearermonitor.h
index 45e7275..df1c78b 100644
--- a/examples/network/bearermonitor/bearermonitor.h
+++ b/examples/network/bearermonitor/bearermonitor.h
@@ -45,7 +45,7 @@
#include <qnetworksession.h>
#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
#include "ui_bearermonitor_240_320.h"
-#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+#elif defined(MAEMO_UI)
#include "ui_bearermonitor_maemo.h"
#else
#include "ui_bearermonitor_640_480.h"
@@ -81,7 +81,7 @@ private slots:
void createSessionFor(QTreeWidgetItem *item);
void createNewSession();
-#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6)
+#ifndef MAEMO_UI
void deleteSession();
#endif
void performScan();
diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro
index 42100bc..bd9bd68 100644
--- a/examples/network/bearermonitor/bearermonitor.pro
+++ b/examples/network/bearermonitor/bearermonitor.pro
@@ -8,7 +8,8 @@ SOURCES = main.cpp \
bearermonitor.cpp \
sessionwidget.cpp
-maemo5|maemo6 {
+maemo5|maemo6|linux-g++-maemo {
+ DEFINES += MAEMO_UI
FORMS = bearermonitor_maemo.ui \
sessionwidget_maemo.ui
} else {
@@ -17,8 +18,8 @@ maemo5|maemo6 {
sessionwidget.ui
}
-win32:!wince*:LIBS += -lWs2_32
-wince*:LIBS += -lWs2
+win32:!wince*:LIBS += -lws2_32
+wince*:LIBS += -lws2
CONFIG += console
diff --git a/examples/network/bearermonitor/bearermonitor_maemo.ui b/examples/network/bearermonitor/bearermonitor_maemo.ui
index a7940c6..9c72bfd 100644
--- a/examples/network/bearermonitor/bearermonitor_maemo.ui
+++ b/examples/network/bearermonitor/bearermonitor_maemo.ui
@@ -7,300 +7,359 @@
<x>0</x>
<y>0</y>
<width>612</width>
- <height>495</height>
+ <height>555</height>
</rect>
</property>
<property name="windowTitle">
<string>BearerMonitor</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0">
<item>
- <widget class="QTabWidget" name="tabWidget">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <widget class="QGroupBox" name="systemState">
+ <property name="title">
+ <string>System State</string>
</property>
- <property name="currentIndex">
- <number>0</number>
+ <property name="flat">
+ <bool>true</bool>
</property>
- <property name="usesScrollButtons">
- <bool>false</bool>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="onlineStateLabel">
+ <property name="text">
+ <string>Online State:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="onlineState">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="configurations">
+ <property name="title">
+ <string>Configurations &amp;&amp; Sessions</string>
</property>
- <widget class="QWidget" name="tab">
- <attribute name="title">
- <string>Configurations</string>
- </attribute>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QTreeWidget" name="treeWidget">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <attribute name="headerVisible">
- <bool>false</bool>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <property name="usesScrollButtons">
+ <bool>false</bool>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Configurations</string>
</attribute>
- <column>
- <property name="text">
- <string>1</string>
- </property>
- </column>
- </widget>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <layout class="QHBoxLayout" name="configurationNameLayout">
- <item>
- <widget class="QLabel" name="configurationNameLabel">
- <property name="text">
- <string>Name:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="configurationName">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="configurationStateLayout">
- <item>
- <widget class="QLabel" name="configurationStateLabel">
- <property name="text">
- <string>State:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="configurationState">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="configurationTypeLayout">
- <item>
- <widget class="QLabel" name="configurationTypeLabel">
- <property name="text">
- <string>Type:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="configurationType">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Invalid</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="configurationPurposeLayout">
- <item>
- <widget class="QLabel" name="configurationPurposeLabel">
- <property name="text">
- <string>Purpose:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="configurationPurpose">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Unknown</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="configurationIdentifierLayout">
- <item>
- <widget class="QLabel" name="configurationIdentifierLabel">
- <property name="text">
- <string>Identifier:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="configurationIdentifier">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="configurationRoamingLayout">
- <item>
- <widget class="QLabel" name="configurationRoamingLabel">
- <property name="text">
- <string>Roaming:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="configurationRoaming">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="configurationChildrenLayout">
- <item>
- <widget class="QLabel" name="configurationChildrenLabel">
- <property name="text">
- <string>Children:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="configurationChildren">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QTreeWidget" name="treeWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>false</bool>
+ </property>
+ <attribute name="headerVisible">
+ <bool>false</bool>
+ </attribute>
+ <column>
<property name="text">
- <string/>
+ <string>1</string>
</property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QGroupBox" name="nlaGroup">
- <property name="title">
- <string>Network Location Awareness</string>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout">
+ </column>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="configurationNameLayout">
+ <item>
+ <widget class="QLabel" name="configurationNameLabel">
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configurationName">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="configurationStateLayout">
+ <item>
+ <widget class="QLabel" name="configurationStateLabel">
+ <property name="text">
+ <string>State:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configurationState">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="configurationTypeLayout">
+ <item>
+ <widget class="QLabel" name="configurationTypeLabel">
+ <property name="text">
+ <string>Type:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configurationType">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Invalid</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="configurationPurposeLayout">
+ <item>
+ <widget class="QLabel" name="configurationPurposeLabel">
+ <property name="text">
+ <string>Purpose:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configurationPurpose">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Unknown</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="configurationIdentifierLayout">
+ <item>
+ <widget class="QLabel" name="configurationIdentifierLabel">
+ <property name="text">
+ <string>Identifier:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configurationIdentifier">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="configurationRoamingLayout">
+ <item>
+ <widget class="QLabel" name="configurationRoamingLabel">
+ <property name="text">
+ <string>Roaming:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configurationRoaming">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="configurationChildrenLayout">
+ <item>
+ <widget class="QLabel" name="configurationChildrenLabel">
+ <property name="text">
+ <string>Children:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="configurationChildren">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="nlaGroup">
+ <property name="title">
+ <string>Network Location Awareness</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="registerButton">
+ <property name="text">
+ <string>Register</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="unregisterButton">
+ <property name="text">
+ <string>Unregister</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item>
- <widget class="QPushButton" name="registerButton">
+ <widget class="QPushButton" name="newSessionButton">
<property name="text">
- <string>Register</string>
+ <string>New Session</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="unregisterButton">
+ <widget class="QPushButton" name="deleteSessionButton">
<property name="text">
- <string>Unregister</string>
+ <string>Delete Session</string>
</property>
</widget>
</item>
+ <item>
+ <widget class="QPushButton" name="scanButton">
+ <property name="text">
+ <string>Scan</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressBar">
+ <property name="maximum">
+ <number>0</number>
+ </property>
+ <property name="value">
+ <number>23280</number>
+ </property>
+ <property name="textVisible">
+ <bool>false</bool>
+ </property>
+ <property name="invertedAppearance">
+ <bool>false</bool>
+ </property>
+ <property name="format">
+ <string>%p%</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="newSessionButton">
- <property name="text">
- <string>New Session</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="deleteSessionButton">
- <property name="text">
- <string>Delete Session</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="scanButton">
- <property name="text">
- <string>Scan</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QProgressBar" name="progressBar">
- <property name="maximum">
- <number>0</number>
- </property>
- <property name="value">
- <number>23280</number>
- </property>
- <property name="textVisible">
- <bool>false</bool>
- </property>
- <property name="invertedAppearance">
- <bool>false</bool>
- </property>
- <property name="format">
- <string>%p%</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
diff --git a/examples/network/bearermonitor/main.cpp b/examples/network/bearermonitor/main.cpp
index 1a22c13..11399e4 100644
--- a/examples/network/bearermonitor/main.cpp
+++ b/examples/network/bearermonitor/main.cpp
@@ -38,7 +38,8 @@
**
****************************************************************************/
-#include <QApplication>
+#include <QtGui/QApplication>
+#include <QtGui/QMainWindow>
#include "bearermonitor.h"
@@ -46,8 +47,12 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QMainWindow mainWindow;
+
BearerMonitor monitor;
- monitor.show();
+
+ mainWindow.setCentralWidget(&monitor);
+ mainWindow.show();
return app.exec();
}
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index 5ec9d53..51de0f2 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -74,7 +74,7 @@ SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *paren
this, SLOT(closeSession()));
connect(stopSessionButton, SIGNAL(clicked()),
this, SLOT(stopSession()));
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+#ifdef MAEMO_UI
connect(deleteSessionButton, SIGNAL(clicked()),
this, SLOT(deleteSession()));
#endif
@@ -94,7 +94,7 @@ void SessionWidget::timerEvent(QTimerEvent *e)
}
}
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+#ifdef MAEMO_UI
void SessionWidget::deleteSession()
{
delete this;
diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h
index c92db44..846a1af 100644
--- a/examples/network/bearermonitor/sessionwidget.h
+++ b/examples/network/bearermonitor/sessionwidget.h
@@ -42,7 +42,8 @@
#define SESSIONWIDGET_H
#include <qnetworksession.h>
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+
+#ifdef MAEMO_UI
#include "ui_sessionwidget_maemo.h"
#else
#include "ui_sessionwidget.h"
@@ -71,7 +72,7 @@ private Q_SLOTS:
void stopSession();
void updateSession();
void updateSessionError(QNetworkSession::SessionError error);
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+#ifdef MAEMO_UI
void deleteSession();
#endif
diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro
index 4809b91..6417849 100644
--- a/examples/painting/svgviewer/svgviewer.pro
+++ b/examples/painting/svgviewer/svgviewer.pro
@@ -17,7 +17,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svgviewer
INSTALLS += target sources
wince*: {
- addFiles.sources = files\\*.svg
+ addFiles.files = files\\*.svg
addFiles.path = "\\My Documents"
DEPLOYMENT += addFiles
}
@@ -25,7 +25,7 @@ wince*: {
symbian: {
TARGET.UID3 = 0xA000A64E
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
- addFiles.sources = files\\*.svg
+ addFiles.files = files\\*.svg
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
index 0574b2d..67aa1ff 100644
--- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -13,7 +13,7 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince*: {
- addFiles.sources = main.cpp mainwindow.cpp
+ addFiles.files = main.cpp mainwindow.cpp
addFiles.path = .
DEPLOYMENT += addFiles
}
diff --git a/examples/richtext/textobject/textobject.pro b/examples/richtext/textobject/textobject.pro
index 4fa9cb0..222b0fe 100644
--- a/examples/richtext/textobject/textobject.pro
+++ b/examples/richtext/textobject/textobject.pro
@@ -12,7 +12,7 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject
INSTALLS += target sources
-filesToDeploy.sources = files/*.svg
+filesToDeploy.files = files/*.svg
filesToDeploy.path = files
DEPLOYMENT += filesToDeploy
diff --git a/examples/script/context2d/context2d.pro b/examples/script/context2d/context2d.pro
index 54f5c31..6a0e397 100644
--- a/examples/script/context2d/context2d.pro
+++ b/examples/script/context2d/context2d.pro
@@ -27,6 +27,6 @@ symbian:{
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCHEAPSIZE = 0x200000 0xA00000
contextScripts.path = .
- contextScripts.sources = scripts
+ contextScripts.files = scripts
DEPLOYMENT += contextScripts
}
diff --git a/examples/symbianpkgrules.pri b/examples/symbianpkgrules.pri
index a1b6634..0f615c7 100644
--- a/examples/symbianpkgrules.pri
+++ b/examples/symbianpkgrules.pri
@@ -13,4 +13,7 @@ vendorinfo = \
examples_deployment.pkg_prerules += vendorinfo
DEPLOYMENT += examples_deployment
-isEmpty(ICON):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+isEmpty(ICON):contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG, qt):!contains(CONFIG, "no_icon") {
+ ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+}
+
diff --git a/examples/tools/undoframework/mainwindow.cpp b/examples/tools/undoframework/mainwindow.cpp
index b4b7ee5..90b4d3f 100644
--- a/examples/tools/undoframework/mainwindow.cpp
+++ b/examples/tools/undoframework/mainwindow.cpp
@@ -48,7 +48,7 @@
//! [0]
MainWindow::MainWindow()
{
- undoStack = new QUndoStack();
+ undoStack = new QUndoStack(this);
createActions();
createMenus();
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/cppPlugins.pro b/examples/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro
index d85787d..d85787d 100644
--- a/examples/tutorials/gettingStarted/gsQml/filedialog/cppPlugins.pro
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml
new file mode 100644
index 0000000..ffd4be4
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ id: simplebutton
+ color: "grey"
+ width: 150; height: 75
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: "button label"
+ }
+}
+//! [document]
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml
new file mode 100644
index 0000000..bb70cfd
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ property string label: "button label"
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius: 10
+ smooth: true
+ border{color: "white"; width: 3}
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml
new file mode 100644
index 0000000..460f5e9
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml
new file mode 100644
index 0000000..65de4f1
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml
new file mode 100644
index 0000000..5bb50f8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: simplebutton
+
+ //the rectangle's fill color
+ color: "grey"
+
+ //dimensions of the button
+ width: 150; height: 75
+
+ //A text element contains functionalities for creating texts
+ Text {
+ id: buttonLabel
+
+ //center the text inside the parent
+ anchors.centerIn: parent
+
+ //text property binds to the label displayed on the button
+ text: "button label"
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea {
+ id: buttonMouseArea
+ anchors.fill: parent //anchor all sides of the mouse area to the rectangle's anchors
+
+ //onClicked handles valid mouse button clicks
+ onClicked: console.log(buttonLabel.text + " clicked" )
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png
new file mode 100644
index 0000000..aab64bc
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png
new file mode 100644
index 0000000..d3ff66f
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png
new file mode 100644
index 0000000..f2e2b0d
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png
new file mode 100644
index 0000000..21ce509
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml
new file mode 100644
index 0000000..39ac591
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ property string label: "button label"
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius:10
+ smooth: true
+ border{color: "white"; width: 3}
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml
new file mode 100644
index 0000000..fdd06d5
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml
new file mode 100644
index 0000000..bd6669b
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml
new file mode 100644
index 0000000..8065804
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000
+ height:300
+
+ property color fileColor: "thistle"
+ property color editColor: "powderblue"
+
+ //container for the header and the buttons
+ Rectangle{
+
+ id: labelList
+ height:parent.height/10
+ width: parent.width
+ color: "steelblue"
+
+ //default z is 0, items with higher z values are shown on top of items with lower z values
+ z: 1
+
+ //row displays its children in a vertical row
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ height: 20
+ width: 50
+ label: "File"
+ id: fileButton
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ radius: 1
+
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: {
+ menuListView.currentIndex = 0
+ }
+ }
+ Button{
+ height: 20
+ width: 50
+ id: editButton
+ buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: {
+ menuListView.currentIndex = 1
+ }
+
+
+ }
+
+
+ }
+ }
+
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png b/examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png
new file mode 100644
index 0000000..da959a3
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml
new file mode 100644
index 0000000..39ac591
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ property string label: "button label"
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius:10
+ smooth: true
+ border{color: "white"; width: 3}
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml
new file mode 100644
index 0000000..fdd06d5
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml
new file mode 100644
index 0000000..bd6669b
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml
new file mode 100644
index 0000000..8065804
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000
+ height:300
+
+ property color fileColor: "thistle"
+ property color editColor: "powderblue"
+
+ //container for the header and the buttons
+ Rectangle{
+
+ id: labelList
+ height:parent.height/10
+ width: parent.width
+ color: "steelblue"
+
+ //default z is 0, items with higher z values are shown on top of items with lower z values
+ z: 1
+
+ //row displays its children in a vertical row
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ height: 20
+ width: 50
+ label: "File"
+ id: fileButton
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ radius: 1
+
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: {
+ menuListView.currentIndex = 0
+ }
+ }
+ Button{
+ height: 20
+ width: 50
+ id: editButton
+ buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: {
+ menuListView.currentIndex = 1
+ }
+
+
+ }
+
+
+ }
+ }
+
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml
new file mode 100644
index 0000000..b0bf664
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id:textArea
+
+ width :400
+ height:400
+ color: "white"
+
+ Flickable{
+ id: flickArea
+
+ width: parent.width
+ height: parent.height
+ anchors.fill:parent
+
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit{
+ id: textEditor
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:"midnightblue"
+ focus: true
+
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml
new file mode 100644
index 0000000..7f0e650
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+
+ id: screen
+ width: 1000; height: 1000
+ border.color:"black"
+ //the screen is partitioned into the MenuBar and TextArea. 1/3 of the screen is assigned to the MenuBar
+ property int partition: height/3
+
+ MenuBar{
+ id:menuBar
+ height: partition
+ width:parent.width
+ z: 1
+ }
+
+
+ TextArea{
+ id:textArea
+ anchors.bottom:parent.bottom
+ y: partition
+ color: "azure"
+ height: partition*2
+ width:parent.width
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png b/examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png
new file mode 100644
index 0000000..14978c2
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png b/examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png
new file mode 100644
index 0000000..d0623b5
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml
new file mode 100644
index 0000000..36833f5
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //attaches to the Text element's text content
+ property string label
+ property color textColor: buttonLabel.color
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius:10
+ smooth: true
+ border.color: "white"
+ border.width: 3
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label //"button label" //bind the text to the parent's text
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ //animate the color whenever the color property changes
+ Behavior on color { ColorAnimation{ duration: 55} }
+
+ //scale the button when pressed
+ scale: buttonMouseArea.pressed ? 1.1 : 1.00
+ //Animate the scale property change
+ Behavior on scale { NumberAnimation{ duration: 55} }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml
new file mode 100644
index 0000000..f0a0e36
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6A6F70" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A6D67") }
+ }
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml
new file mode 100644
index 0000000..d257d6a
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6C646A" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") }
+ }
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml
new file mode 100644
index 0000000..5b0dbf8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000
+ height:300
+
+ property color fileColor: "plum"
+ property color editColor: "powderblue"
+
+ //container for the header and the buttons
+ Rectangle{
+
+ id: labelList
+ height:parent.height/10
+ width: parent.width
+ color: "beige"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+
+ //default z is 0, items with higher z values are shown on top of items with lower z values
+ z: 1
+
+ //row displays its children in a vertical row
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ height: 20
+ width: 50
+ label: "File"
+ id: fileButton
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ radius: 1
+
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: {
+ menuListView.currentIndex = 0
+ }
+ }
+ Button{
+ height: 20
+ width: 50
+ id: editButton
+ buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: {
+ menuListView.currentIndex = 1
+ }
+
+
+ }
+
+
+ }
+ }
+
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml
new file mode 100644
index 0000000..d360faa
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: simplebutton
+ color: "grey"
+ width: 150; height: 75
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: "button label"
+ }
+
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent
+ onClicked: console.log(buttonLabel.text + " clicked" )
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml
new file mode 100644
index 0000000..4eedf34
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id:textArea
+
+ width :400
+ height:400
+ property color fontColor: "white"
+
+ Flickable{
+ id: flickArea
+
+ width: parent.width
+ height: parent.height
+ anchors.fill:parent
+
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit{
+ id: textEditor
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:fontColor
+ focus: true
+
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml
new file mode 100644
index 0000000..d218bba
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: screen
+ width: 1000; height: 1000
+ property int partition: height/3
+ state: "DRAWER_CLOSED"
+
+
+ //Item 1: MenuBar on the top portion of the screen
+ MenuBar{
+ id:menuBar
+ height: partition
+ //anchors.top:parent.top
+ width:parent.width
+ z:1
+ }
+
+
+ //Item 2: The editable text area
+ TextArea{
+ id:textArea
+ y:drawer.height
+ border.color: Qt.darker(color, 1.4)
+ border.width: 2
+ color: "#3F3F3F"
+ fontColor: "#DCDCCC"
+ height: partition*2
+ width:parent.width
+ }
+
+ //Item 3: The drawer handle
+ Rectangle{
+ id:drawer
+ height:15
+ width: parent.width
+ border.color : "#6A6D6A"
+ border.width: 1
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.77; color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#6A6D6A" }
+ }
+
+ Image{
+ id: arrowIcon
+ source: "images/arrow.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Behavior{NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }}
+ }
+
+ MouseArea{
+ id: drawerMouseArea
+ anchors.fill:parent
+ onClicked:{
+ if (screen.state == "DRAWER_CLOSED"){
+ screen.state = "DRAWER_OPEN"
+ console.log("drawer OPEN")
+ }
+ else if (screen.state == "DRAWER_OPEN"){
+ screen.state = "DRAWER_CLOSED"
+ console.log("drawer closed")
+ }
+ }
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = Qt.lighter("#6A6D6A")
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = "#6A6D6A"
+ }
+
+ }
+ states:[
+ State{
+ name: "DRAWER_OPEN"
+ PropertyChanges { target: menuBar; y:0}
+ PropertyChanges { target: textArea; y: partition + drawer.height}
+ PropertyChanges { target: drawer; y: partition}
+ PropertyChanges { target: arrowIcon; rotation: 180}
+ },
+ State{
+ name: "DRAWER_CLOSED"
+ PropertyChanges { target: menuBar; y:-partition}
+ PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height}
+ PropertyChanges { target: drawer; y: 0}
+ PropertyChanges { target: arrowIcon; rotation: 0}
+ }
+
+ ]
+ transitions: [
+ Transition{
+ to: "*"
+ NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo }
+ NumberAnimation { target: menuBar; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ NumberAnimation { target: drawer; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ }
+
+ ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png b/examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png
new file mode 100644
index 0000000..14978c2
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png b/examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png
new file mode 100644
index 0000000..a195fb8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml
new file mode 100644
index 0000000..4adcf05
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+import "core"
+
+Rectangle {
+ id: screen
+ width: 1000; height: 1000
+ property int partition: height/3
+ state: "DRAWER_CLOSED"
+
+ //Item 1: MenuBar on the top portion of the screen
+ MenuBar{
+ id:menuBar
+ height: screen.partition; width: screen.width
+ z:1
+ }
+ //Item 2: The editable text area
+ TextArea{
+ id:textArea
+ y:drawer.height
+ color: "#3F3F3F"
+ fontColor: "#DCDCCC"
+ height: partition*2; width:parent.width
+ }
+ //Item 3: The drawer handle
+ Rectangle{
+ id:drawer
+ height:15; width: parent.width
+ border.color : "#6A6D6A"
+ border.width: 1
+ z:1
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.77; color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#6A6D6A" }
+ }
+ Image{
+ id: arrowIcon
+ source: "images/arrow.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Behavior{NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }}
+ }
+
+ MouseArea{
+ id: drawerMouseArea
+ anchors.fill:parent
+ hoverEnabled: true
+ onEntered: parent.border.color = Qt.lighter("#6A6D6A")
+ onExited: parent.border.color = "#6A6D6A"
+ onClicked:{
+ if (screen.state == "DRAWER_CLOSED"){
+ screen.state = "DRAWER_OPEN"
+ }
+ else if (screen.state == "DRAWER_OPEN"){
+ screen.state = "DRAWER_CLOSED"
+ }
+ }
+ }
+ }
+
+ states:[
+ State{
+ name: "DRAWER_OPEN"
+ PropertyChanges { target: menuBar; y: 0}
+ PropertyChanges { target: textArea; y: partition + drawer.height}
+ PropertyChanges { target: drawer; y: partition}
+ PropertyChanges { target: arrowIcon; rotation: 180}
+ },
+ State{
+ name: "DRAWER_CLOSED"
+ PropertyChanges { target: menuBar; y:-height; }
+ PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height}
+ PropertyChanges { target: drawer; y: 0}
+ PropertyChanges { target: arrowIcon; rotation: 0}
+ }
+ ]
+
+ transitions: [
+ Transition{
+ to: "*"
+ NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo }
+ NumberAnimation { target: menuBar; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ NumberAnimation { target: drawer; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ }
+ ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml
new file mode 100644
index 0000000..c0c1f77
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //attaches to the Text element's text content
+ property string label
+ property color textColor: buttonLabel.color
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "lightsteelblue"
+ property color borderColor: "transparent"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ property real labelSize: 14
+ //set appearance properties
+ radius:6
+ smooth: true
+ border.width: 2
+ border.color: borderColor
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label //bind the text to the parent's text
+ color: "#DCDCCC"
+ font.pointSize: labelSize
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ //animate the color whenever the color property changes
+ Behavior on color { ColorAnimation{ duration: 55} }
+
+ //scale the button when pressed
+ scale: buttonMouseArea.pressed ? 1.1 : 1.00
+ //Animate the scale property change
+ Behavior on scale { NumberAnimation{ duration: 55} }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml
new file mode 100644
index 0000000..4338d25
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property color buttonBorderColor: "#7A8182"
+ property color buttonFillColor: "#61BDCACD"
+ property string menuName:"Edit"
+
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6A7570" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A7570") }
+ }
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/9
+ Button{
+ id: loadButton
+ buttonColor: buttonFillColor
+ label: "Copy"
+ labelSize:16
+ borderColor:buttonBorderColor
+ height: actionContainer.height
+ width: actionContainer.width/6
+ onButtonClick:textArea.copy()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+
+ Button{
+ id: saveButton
+ height: actionContainer.height
+ width: actionContainer.width/6
+ buttonColor: buttonFillColor
+ label: "Paste"
+ borderColor:buttonBorderColor
+ labelSize:16
+ onButtonClick:textArea.paste()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ height: actionContainer.height
+ width: actionContainer.width/6
+ labelSize:16
+ buttonColor: buttonFillColor
+ borderColor:buttonBorderColor
+ onButtonClick:textArea.selectAll()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml
new file mode 100644
index 0000000..af9d82c
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id:dialog
+ height: 200 * partition; width: 200
+ color: "transparent"
+
+ signal selectChanged()
+ signal notifyRefresh()
+ onNotifyRefresh:dirView.model = directory.files
+
+ property string selectedFile
+ property int selectedIndex: 0
+
+ Rectangle{
+ id: dirBox
+ radius: 10
+ anchors.centerIn:parent
+ height: parent.height -15; width: parent.width -30
+
+ Rectangle{
+ id:header
+ height:parent.height*0.1
+ width: parent.width
+ radius:3
+ z:1
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ Text{
+ height: header.height
+ anchors.centerIn: header
+ text: "files:"
+ color: "lightblue"
+ font.weight: Font.Light
+ font.italic: true
+ }
+ }
+ GridView{
+ id:dirView
+ width:parent.width
+ height:parent.height*.9
+ anchors.top: header.bottom
+ cellWidth: 100
+ cellHeight: 75
+// highlight: Rectangle { width:cellWidth; height: cellHeight; color: "lightsteelblue" ;radius: 13}
+ model: directory.files
+ delegate: dirDelegate
+ clip: true
+ highlightMoveDuration:40
+ }
+
+ Component{
+ id:dirDelegate
+
+ Rectangle{
+ id:file
+ color: "transparent"
+ width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ Text{
+ id:fileName
+ width: parent.width
+ anchors.centerIn:parent
+ text: name
+ color: "#BDCACD"
+ font.weight: GridView.view.currentIndex == index ? Font.DemiBold : Font.Normal
+ font.pointSize: GridView.view.currentIndex == index ? 12 : 10
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Rectangle{
+ id:selection
+ width:parent.width; height:parent.height
+ anchors.centerIn: parent
+ radius: 10
+ smooth: true
+ scale: GridView.view.currentIndex == index ? 1 : 0.5
+ opacity: GridView.view.currentIndex == index ? 1 : 0
+ Text{
+ id:overlay
+ width: parent.width
+ anchors.centerIn:parent
+ text: name
+ color: "#696167"
+ font.weight: Font.DemiBold
+ font.pointSize: 12
+ smooth:true
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Behavior on opacity{ NumberAnimation{ duration: 45} }
+ Behavior on scale { NumberAnimation{ duration: 45} }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue",1.25) }
+ GradientStop { position: 0.67; color: Qt.darker("lightsteelblue",1.3) }
+ }
+ border.color:"lightsteelblue"
+ border.width:1
+ }
+ MouseArea{
+ id:fileMouseArea
+ anchors.fill:parent
+ hoverEnabled: true
+
+ onClicked:{
+ GridView.view.currentIndex = index
+ selectedFile = directory.files[index].name
+ selectChanged()
+ }
+ onEntered:{
+ fileName.color = "lightsteelblue"
+ fileName.font.weight = Font.DemiBold
+ }
+ onExited: {
+ fileName.font.weight = Font.Normal
+ fileName.color = "#BDCACD"
+ }
+ }
+ }
+ }
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#A5333333" }
+ GradientStop { position: 1.0; color: "#03333333" }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml
new file mode 100644
index 0000000..1d671e4
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml
@@ -0,0 +1,232 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: fileMenu
+ height: 480; width:1000
+ property color buttonBorderColor: "#7F8487"
+ property color buttonFillColor: "#8FBDCACD"
+ property string fileContent:directory.fileContent
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //used to divide the screen into parts.
+ property real partition: 1/3
+
+ color: "#6C646A"
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6C646A" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") }
+ }
+
+ Directory{
+ id:directory
+ filename: textInput.text
+ onDirectoryChanged:fileDialog.notifyRefresh()
+ }
+
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.left: parent.left
+
+ //the height is a good proportion that creates more space at the top of the column of buttons
+ width: fileMenu.width * partition; height: fileMenu.height
+
+ Column{
+ anchors.centerIn: parent
+ spacing: parent.height/32
+ Button{
+ id: saveButton
+ label: "Save"
+ borderColor: buttonBorderColor
+ buttonColor: buttonFillColor
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height / 8
+ labelSize:24
+ onButtonClick:{
+ directory.fileContent = textArea.textContent
+ directory.filename = textInput.text
+ directory.saveFile()
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+
+ }
+ Button{
+ id: loadButton
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height/ 8
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ label: "Load"
+ labelSize:24
+ onButtonClick:{
+ directory.filename = textInput.text
+ directory.loadFile()
+ textArea.textContent = directory.fileContent
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button{
+ id: newButton
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height/ 8
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ label: "New"
+ labelSize:24
+ onButtonClick:{
+ textArea.textContent = ""
+ textInput.text = ""
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+
+ }
+ Rectangle{
+ id: space
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height / 16
+ color:"transparent"
+ }
+ Button{
+ id: exitButton
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height/ 8
+ label: "Exit"
+ labelSize:24
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ onButtonClick:Qt.quit()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ }
+ }
+
+ Rectangle{
+ id:dialogContainer
+
+ width: 2*fileMenu.width * partition; height: fileMenu.height
+ anchors.right:parent.right
+ color:"transparent"
+
+ Column {
+ anchors.centerIn: parent
+ spacing: parent.height /640
+ FileDialog{
+ id:fileDialog
+ height: 2*dialogContainer.height * partition; width: dialogContainer.width
+ onSelectChanged: textInput.text = selectedFile
+ }
+
+ Rectangle{
+ id:lowerPartition
+ height: dialogContainer.height * partition; width: dialogContainer.width
+ color: "transparent"
+
+ Rectangle{
+ id: nameField
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#806F6F6F" }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+
+ radius: 10
+ anchors {centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15}
+ height: parent.height-15; width: parent.width -20
+ border {color:"#4A4A4A"; width:1}
+
+ TextInput{
+ id: textInput
+ z:2
+ anchors {bottom: parent.bottom; topMargin: 10; horizontalCenter:parent.horizontalCenter}
+ width: parent.width - 10
+ height: parent.height -10
+ font.pointSize: 40
+ color:"lightsteelblue"
+ focus:true
+ }
+ Text{
+ id: textInstruction
+ anchors.centerIn:parent
+ text: "Select file name and press save or load"
+ font {pointSize: 11; weight:Font.Light; italic: true}
+ color: "lightblue"
+ z:2
+ opacity: (textInput.text == "") ? 1: 0
+ }
+ Text{
+ id:fieldLabel
+ anchors {top: parent.top; left: parent.left}
+ text: " file name: "
+ font {pointSize: 11; weight: Font.Light; italic: true}
+ color: "lightblue"
+ z:2
+ }
+ MouseArea{
+ anchors.centerIn:parent
+ width: nameField.width; height: nameField.height
+ onClicked:{
+ textInput.text = ""
+ textInput.focus = true
+ textInput.forceFocus()
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml
new file mode 100644
index 0000000..657e5dc
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000; height:300
+ color:"transparent"
+ property color fileColor: "plum"
+ property color editColor: "powderblue"
+
+ property real partition: 1/10
+
+ Column{
+ anchors.fill: parent
+ //container for the header and the buttons
+ z: 1
+ Rectangle{
+ id: labelList
+ height:menuBar.height*partition
+ width: menuBar.width
+ color: "beige"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ Text{
+ height: parent.height
+ anchors {right: labelRow.left ; verticalCenter: parent.bottom}
+ text: "menu: "
+ color: "lightblue"
+ font {weight: Font.Light; italic: true}
+ smooth: true
+ }
+
+ //row displays its children in a vertical row
+ Row{
+ id: labelRow
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ id: fileButton
+ height: 20; width: 50
+ label: "File"
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ labelSize: menuListView.currentIndex == 0? 16:12
+ radius: 1
+ smooth:true
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: menuListView.currentIndex = 0
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: fileColor }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+ }
+ Button{
+ id: editButton
+ height: 20; width: 50
+ buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+ labelSize: menuListView.currentIndex == 1? 16:12
+ smooth:true
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: menuListView.currentIndex = 1
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: editColor }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+ }
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ width:menuBar.width; height: 9*menuBar.height*partition
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+ }
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ id:fileMenu
+ width: menuListView.width; height: menuListView.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width; height: menuListView.height
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml
new file mode 100644
index 0000000..d58c159
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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 1.0
+
+Rectangle {
+ id:textArea
+
+ function paste(){ textEdit.paste()}
+ function copy() { textEdit.copy() }
+ function selectAll() { textEdit.selectAll() }
+
+ width :400; height:400
+
+ property color fontColor: "white"
+ property alias textContent: textEdit.text
+ Flickable{
+ id: flickArea
+ width: parent.width; height: parent.height
+ anchors.fill:parent
+
+ boundsBehavior: Flickable.StopAtBounds
+ flickableDirection: Flickable.HorizontalFlick
+ interactive: true
+ //Will move the text Edit area to make the area visible when scrolled with keyboard strokes
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit{
+ id: textEdit
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:fontColor
+ focus: true
+ wrapMode: TextEdit.Wrap
+ font.pointSize:10
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ selectByMouse: true
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir
new file mode 100644
index 0000000..3f22778
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir
@@ -0,0 +1,13 @@
+
+Button ./Button.qml
+FileDialog ./FileDialog.qml
+TextArea ./TextArea.qml
+TextEditor ./TextEditor.qml
+EditMenu ./EditMenu.qml
+MenuBar ./MenuBar.qml
+
+plugin FileDialog ../plugins
+
+
+
+
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp
new file mode 100644
index 0000000..7ea44ce
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+#include "dialogPlugin.h"
+#include "directory.h"
+#include "file.h"
+#include <QtDeclarative/qdeclarative.h>
+
+void DialogPlugin::registerTypes(const char *uri){
+
+ //register the class Directory into QML as a "Directory" element version 1.0
+ qmlRegisterType<Directory>(uri, 1, 0, "Directory");
+ qmlRegisterType<File>(uri,1,0,"File");
+
+ //qRegisterMetaType<QDeclarativeListProperty<QString> > ("QDeclarativeListProperty<QString>");
+
+}
+
+//FileDialog is the plugin name (same as the TARGET in the project file) and DialogPlugin is the plugin classs
+Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin); \ No newline at end of file
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h
new file mode 100644
index 0000000..188e070
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+#ifndef DIALOGPLUGIN_H
+#define DIALOGPLUGIN_H
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class DialogPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+
+ public:
+ //registerTypes is inherited from QDeclarativeExtensionPlugin
+ void registerTypes(const char *uri);
+
+};
+
+#endif
+
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp
new file mode 100644
index 0000000..cddfa03
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp
@@ -0,0 +1,219 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+#include "directory.h"
+#include <QDebug>
+
+/*
+Directory constructor
+
+Initialize the saves directory and creates the file list
+*/
+Directory::Directory(QObject *parent) : QObject(parent)
+{
+
+
+ m_dir.cd( QDir::currentPath());
+
+ //go to the saved directory. if not found, create save directory
+ m_saveDir = "saves";
+ if (m_dir.cd(m_saveDir) == 0){
+ m_dir.mkdir(m_saveDir);
+ m_dir.cd(m_saveDir);
+ }
+ m_filterList << "*.txt";
+
+ refresh();
+}
+
+/*
+Directory::filesNumber
+Return the number of Files
+*/
+int Directory:: filesCount() const{
+ return m_fileList.size();
+}
+
+/*
+Function called to append data onto list property
+*/
+void appendFiles(QDeclarativeListProperty<File> * property, File * file){
+ //Do nothing. can't add to a directory using this method
+}
+
+/*
+Function called to retrieve file in the list using an index
+*/
+File* fileAt(QDeclarativeListProperty<File> * property, int index){
+ return static_cast< QList<File *> *>(property->data)->at(index);
+}
+
+/*
+Returns the number of files in the list
+*/
+int filesSize(QDeclarativeListProperty<File> * property){
+ return static_cast< QList<File *> *>(property->data)->size();
+}
+
+/*
+Function called to empty the list property contents
+*/
+void clearFilesPtr(QDeclarativeListProperty<File> *property){
+ return static_cast< QList<File *> *>(property->data)->clear();
+}
+
+/*
+Returns the list of files as a QDeclarativeListProperty.
+*/
+QDeclarativeListProperty<File> Directory::files(){
+
+ refresh();
+// return QDeclarativeListProperty<QString>(this,m_filePtrList); //not recommended in the docs
+ return QDeclarativeListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr );
+}
+
+/*
+Return te name of the currently selected file
+*/
+QString Directory::filename() const{
+ return currentFile.name();
+}
+
+/*
+Return the file's content as a string.
+*/
+QString Directory::fileContent() const{
+ return m_fileContent;
+}
+
+/*
+Set the file name of the current file
+*/
+void Directory::setFilename(const QString &str){
+ if(str != currentFile.name()){
+ currentFile.setName(str);
+ emit filenameChanged();
+ }
+}
+
+/*
+Set the content of the file as a string
+*/
+void Directory::setFileContent(const QString &str){
+ if(str != m_fileContent){
+ m_fileContent = str;
+ emit fileContentChanged();
+ }
+}
+
+/*
+Called from QML to save the file using the filename and file content.
+Saving makes sure that the file has a .txt extension.
+*/
+void Directory::saveFile(){
+
+ if(currentFile.name().size() == 0){
+ qWarning()<< "Empty filename. no save";
+ return;
+ }
+
+ QString extendedName = currentFile.name();
+ if(!currentFile.name().endsWith(".txt")){
+ extendedName.append(".txt");
+ }
+
+ QFile file( m_dir.filePath(extendedName) );
+ if (file.open(QFile::WriteOnly | QFile::Truncate)){
+ QTextStream outStream(&file);
+ outStream << m_fileContent;
+ }
+ file.close();
+ refresh();
+ emit directoryChanged();
+}
+
+/*
+Load the contents of a file.
+Only loads files with a .txt extension
+*/
+void Directory::loadFile(){
+
+ m_fileContent.clear();
+ QString extendedName = currentFile.name();
+ if(!currentFile.name().endsWith(".txt")){
+ extendedName.append(".txt");
+ }
+
+ QFile file( m_dir.filePath(extendedName) );
+ if (file.open(QFile::ReadOnly )){
+ QTextStream inStream(&file);
+
+ QString line;
+ do{
+ line = inStream.read(75);
+ m_fileContent.append(line);
+ }while (!line .isNull());
+ }
+ file.close();
+}
+
+/*
+Reloads the content of the files list. This is to ensure that the newly
+created files are added onto the list.
+*/
+void Directory::refresh(){
+ m_dirFiles = m_dir.entryList(m_filterList,QDir::Files,QDir::Name);
+ m_fileList.clear();
+
+ File * file;
+ for(int i = 0; i < m_dirFiles.size() ; i ++){
+
+ file = new File();
+
+ if(m_dirFiles.at(i).endsWith(".txt")){
+ QString name = m_dirFiles.at(i);
+ file->setName( name.remove(".txt",Qt::CaseSensitive));
+ }
+ else{
+ file->setName(m_dirFiles.at(i));
+ }
+ m_fileList.append(file);
+ }
+} \ No newline at end of file
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h
new file mode 100644
index 0000000..417df68
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+#ifndef DIRECTORY_H
+#define DIRECTORY_H
+
+#include "file.h"
+
+#include <QDir>
+#include <QStringList>
+#include <QTextStream>
+#include <QDeclarativeListProperty>
+#include <QObject>
+
+class Directory : public QObject{
+
+ Q_OBJECT
+
+ //number of files in the directory
+ Q_PROPERTY(int filesCount READ filesCount)
+
+ //list property containing file names as QString
+ Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
+
+ //file name of the text file to read/write
+ Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
+
+ //text content of the file
+ Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
+
+ public:
+ Directory(QObject *parent = 0);
+
+ //properties' read functions
+ int filesCount() const;
+ QString filename() const;
+ QString fileContent() const;
+ QDeclarativeListProperty<File> files();
+
+ //properties' write functions
+ void setFilename(const QString &str);
+ void setFileContent(const QString &str);
+
+ //accessible from QML
+ Q_INVOKABLE void saveFile();
+ Q_INVOKABLE void loadFile();
+
+ signals:
+ void directoryChanged();
+ void filenameChanged();
+ void fileContentChanged();
+
+ private:
+ QDir m_dir;
+ QStringList m_dirFiles;
+ File currentFile;
+ QString m_saveDir;
+ QStringList m_filterList;
+
+ //contains the file data in QString format
+ QString m_fileContent;
+
+ //Registered to QML in a plugin. Accessible from QML as a property of Directory
+ QList<File *> m_fileList;
+
+ //refresh content of the directory
+ void refresh();
+};
+
+
+#endif
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp
new file mode 100644
index 0000000..f4a360a
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+#include "file.h"
+
+File::File(QObject *parent) : QObject(parent)
+{
+ m_name = "";
+}
+
+QString File::name() const{
+ return m_name;
+}
+void File::setName(const QString &str){
+ if(str != m_name){
+ m_name = str;
+ emit nameChanged();
+ }
+} \ No newline at end of file
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h
new file mode 100644
index 0000000..b27a143
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+#ifndef FILE_H
+#define FILE_H
+
+
+#include <QString>
+#include <QObject>
+
+class File : public QObject{
+
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+
+ public:
+ File(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &str);
+
+ signals:
+ void nameChanged();
+
+ private:
+ QString m_name;
+};
+
+#endif \ No newline at end of file
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro
new file mode 100644
index 0000000..6247747
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro
@@ -0,0 +1,17 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR += ../plugins
+OBJECTS_DIR = tmp
+MOC_DIR = tmp
+
+TARGET = FileDialog
+
+HEADERS += directory.h \
+ file.h \
+ dialogPlugin.h
+
+SOURCES += directory.cpp \
+ file.cpp \
+ dialogPlugin.cpp
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir
new file mode 100644
index 0000000..c2b27da
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir
@@ -0,0 +1 @@
+plugin FileDialog plugins
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png
new file mode 100644
index 0000000..14978c2
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png
new file mode 100644
index 0000000..27feed5
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png
new file mode 100644
index 0000000..4d8f9f2
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png
new file mode 100644
index 0000000..680acfe
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject
new file mode 100644
index 0000000..ed034df
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject
@@ -0,0 +1,18 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ directory: "core"
+ directory: "filedialog"
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ " ./plugins " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/texteditor.pro b/examples/tutorials/gettingStarted/gsQml/texteditor.pro
new file mode 100644
index 0000000..aa5306c
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/texteditor.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ filedialog\
+
diff --git a/examples/webkit/imageanalyzer/README b/examples/webkit/imageanalyzer/README
new file mode 100644
index 0000000..9415b57
--- /dev/null
+++ b/examples/webkit/imageanalyzer/README
@@ -0,0 +1,20 @@
+This example demonstrates the use of Qt WebKit to make a hybrid application.
+
+Build instructions:
+
+ On Mac OS X:
+ In this directory:
+ qmake -spec macx-g++
+ make clean all
+ open imageanalyzer.app
+ On Linux/Unix:
+ In this directory:
+ qmake
+ make clean all
+ ./imageanalyzer
+
+ On Windows:
+ In this directory:
+ qmake
+ nmake clean all
+ debug\imageanalyzer.exe
diff --git a/examples/webkit/imageanalyzer/imageanalyzer.cpp b/examples/webkit/imageanalyzer/imageanalyzer.cpp
new file mode 100644
index 0000000..9f49a00
--- /dev/null
+++ b/examples/webkit/imageanalyzer/imageanalyzer.cpp
@@ -0,0 +1,222 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+
+#include <QNetworkReply>
+#include <QNetworkRequest>
+#include <QNetworkAccessManager>
+#include <QNetworkDiskCache>
+#include "imageanalyzer.h"
+
+/*!
+ * This class operates as follows:
+ * Parent calls the slot startAnalysis which shoves a list of QStrings into URLQueue and then calls fetchURLs.
+ * FetchURLs sends out HTTP GETs for each image it can't get out of the cache.
+ * As the responses come in, handleReply tries to create an image out of each and pushes those images into imageQueue.
+ * On the last (detected by no outstandingFetches and URLQueue.isEmpty()) call to queueImage (from handleReply)
+ * a thread is forked to process all the images. When it finishes, it emits a finished signal that is received
+ * by our JavaScript code.
+ */
+
+//! [ ImageAnalyzer - Constructor ]
+ImageAnalyzer::ImageAnalyzer(QNetworkDiskCache* netcache, QObject* parent)
+ : QObject(parent), m_cache(netcache), m_outstandingFetches(0)
+{
+ /* ImageAnalyzer only wants to receive http responses
+ for requests that it makes, so that's why it has its own
+ QNetworkAccessManager. */
+ m_network = new QNetworkAccessManager(this);
+ m_watcher = new QFutureWatcher<QRgb>(this);
+ /* We want to share a cache with the web browser,
+ in case it has some images we want: */
+ m_network->setCache(m_cache);
+
+ QObject::connect(m_network, SIGNAL(finished(QNetworkReply*)),
+ this, SLOT(handleReply(QNetworkReply*)));
+ QObject::connect(m_watcher, SIGNAL(finished()),
+ this, SLOT(doneProcessing()));
+ QObject::connect(m_watcher, SIGNAL(progressValueChanged(int)),
+ this, SLOT(progressStatus(int)));
+}
+//! [ ImageAnalyzer - Constructor ]
+ImageAnalyzer::~ImageAnalyzer()
+{
+ delete(m_watcher);
+}
+
+
+QRgb ImageAnalyzer::lastResults()
+{
+ int rTot = 0;
+ int bTot = 0;
+ int gTot = 0;
+ int count = m_watcher->future().results().size();
+ foreach(const QRgb & triplet, m_watcher->future().results())
+ {
+ rTot += qRed(triplet);
+ bTot += qBlue(triplet);
+ gTot += qGreen(triplet);
+ }
+ return qRgb(rTot/count, bTot/count, gTot/count);
+}
+
+float ImageAnalyzer::lastRed() { return qRed(lastResults())/2.55; }
+float ImageAnalyzer::lastGreen() { return qGreen(lastResults())/2.55; }
+float ImageAnalyzer::lastBlue() { return qBlue(lastResults())/2.55; }
+
+void ImageAnalyzer::progressStatus(int newstat)
+{
+ emit updateProgress(newstat, m_watcher->progressMaximum());
+}
+
+
+bool ImageAnalyzer::isBusy()
+{
+ return m_watcher->isRunning();
+}
+
+
+//! [ ImageAnalyzer - startAnalysis ]
+void ImageAnalyzer::startAnalysis(const QStringList & urls)
+{
+ m_URLQueue = urls;
+ fetchURLs();
+}
+//! [ ImageAnalyzer - startAnalysis ]
+
+/*!
+ * Analyzes the entire queue - just starts all our http GETs.
+ */
+//! [ ImageAnalyzer - fetchURLs ]
+void ImageAnalyzer::fetchURLs()
+{
+ while (!m_URLQueue.isEmpty())
+ {
+ QString url = m_URLQueue.takeFirst();
+ QUrl URL = QUrl(url);
+ QIODevice * pData = m_cache->data(URL);
+ // Is image already loaded in cache?
+ if (pData == 0) {
+ // HTTP Get image over network.
+ m_outstandingFetches++;
+ QNetworkRequest request = QNetworkRequest(URL);
+ request.setRawHeader("User-Agent", "Nokia - Custom QT app");
+ m_network->get(request);
+ } else {
+ // Get image from cache
+ QImage image;
+ image.load(pData, 0);
+ if (!image.isNull())
+ queueImage(image);
+ delete(pData);
+ }
+ }
+}
+//! [ ImageAnalyzer - fetchURLs ]
+/*
+ * Slot to handle the incoming responses from our http GETs
+ */
+//! [ ImageAnalyzer - handleReply ]
+void ImageAnalyzer::handleReply(QNetworkReply * pReply)
+{
+ m_outstandingFetches--;
+ if (pReply->error()) {
+ qDebug() << "Error code" << pReply->error();
+ qDebug() << "Http code" << pReply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
+ return;
+ }
+ QImage image;
+ image.load(pReply, 0);
+ pReply->deleteLater();
+ if (image.isNull()) {
+ qDebug() << "bad image";
+ qDebug() << pReply->rawHeaderList();
+ foreach(QByteArray element, pReply->rawHeaderList()) {
+ qDebug() << element << " = " << pReply->rawHeader(element);
+ }
+ return;
+ }
+ queueImage(image);
+}
+//! [ ImageAnalyzer - handleReply ]
+
+void ImageAnalyzer::doneProcessing()
+{
+ m_imageQueue = QList<QImage>();
+ emit finishedAnalysis();
+}
+//! [ ImageAnalyzer - queueImage ]
+void ImageAnalyzer::queueImage(QImage img)
+{
+ if (!img.isNull())
+ m_imageQueue << img;
+
+ if (m_outstandingFetches == 0 && m_URLQueue.isEmpty()) {
+ m_watcher->setFuture(QtConcurrent::mapped(m_imageQueue, averageRGB));
+ }
+}
+//! [ ImageAnalyzer - queueImage ]
+
+//! [ ImageAnalyzer - averageRGB ]
+QRgb averageRGB(const QImage &img)
+{
+ int pixelCount = img.width() * img.height();
+ int rAvg, gAvg, bAvg;
+
+ // We waste some time here:
+ for (int timeWaster=0; timeWaster < 100; timeWaster++) {
+ quint64 rTot = 0;
+ quint64 gTot = 0;
+ quint64 bTot = 0;
+ for (int i=0; i < img.width(); i++) {
+ for (int j=0; j < img.height(); j++) {
+ QRgb pixel = img.pixel(i,j);
+ rTot += qRed(pixel);
+ gTot += qGreen(pixel);
+ bTot += qBlue(pixel);
+ }
+ }
+ rAvg = (rTot)/(pixelCount);
+ gAvg = (gTot)/(pixelCount);
+ bAvg = (bTot)/(pixelCount);
+ }
+ return qRgb(rAvg, gAvg, bAvg);
+}
+//! [ ImageAnalyzer - averageRGB ]
diff --git a/examples/webkit/imageanalyzer/imageanalyzer.h b/examples/webkit/imageanalyzer/imageanalyzer.h
new file mode 100644
index 0000000..5a96909
--- /dev/null
+++ b/examples/webkit/imageanalyzer/imageanalyzer.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+#ifndef IMAGEANALYZER_H
+#define IMAGEANALYZER_H
+
+#include <QFutureWatcher>
+#include <QtGui>
+
+QT_BEGIN_NAMESPACE
+class QNetworkAccessManager;
+class QNetworkReply;
+class QNetworkDiskCache;
+QT_END_NAMESPACE
+
+//! [ ImageAnalyzer - public interface ]
+class ImageAnalyzer : public QObject
+{
+ Q_OBJECT
+public:
+ ImageAnalyzer(QNetworkDiskCache * netcache, QObject * parent=0);
+
+ QRgb lastResults();
+ float lastRed();
+ float lastGreen();
+ float lastBlue();
+ bool isBusy();
+ Q_PROPERTY(bool busy READ isBusy);
+ Q_PROPERTY(float red READ lastRed);
+ Q_PROPERTY(float green READ lastGreen);
+ Q_PROPERTY(float blue READ lastBlue);
+ ~ImageAnalyzer();
+
+public slots:
+ /*! initiates analysis of all the urls in the list */
+ void startAnalysis(const QStringList & urls);
+
+signals:
+ void finishedAnalysis();
+ void updateProgress(int completed, int total);
+ //! [ ImageAnalyzer - public interface ]
+
+private slots:
+ void handleReply(QNetworkReply*);
+ void doneProcessing();
+ void progressStatus(int);
+
+private:
+ QRgb processImages();
+ void fetchURLs();
+ void queueImage(QImage img);
+
+ //! [ ImageAnalyzer - private members ]
+private:
+ QNetworkAccessManager* m_network;
+ QNetworkDiskCache* m_cache;
+ QStringList m_URLQueue;
+ QList<QImage> m_imageQueue;
+ int m_outstandingFetches;
+ QFutureWatcher<QRgb> * m_watcher;
+ //! [ ImageAnalyzer - private members ]
+};
+
+QRgb averageRGB(const QImage &img);
+
+#endif
diff --git a/examples/webkit/imageanalyzer/imageanalyzer.pro b/examples/webkit/imageanalyzer/imageanalyzer.pro
new file mode 100644
index 0000000..c9a0ed1
--- /dev/null
+++ b/examples/webkit/imageanalyzer/imageanalyzer.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+HEADERS = imageanalyzer.h \
+ mainwindow.h
+SOURCES = imageanalyzer.cpp \
+ main.cpp \
+ mainwindow.cpp
+
+QT += network webkit
+
+RESOURCES = resources/imageanalyzer.qrc
+
+OTHER_FILES += html/index.html README ../webkit-bridge-tutorial.qdoc outline.txt
+
+
diff --git a/examples/webkit/imageanalyzer/main.cpp b/examples/webkit/imageanalyzer/main.cpp
new file mode 100644
index 0000000..c3f04de
--- /dev/null
+++ b/examples/webkit/imageanalyzer/main.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+
+#include "imageanalyzer.h"
+#include "mainwindow.h"
+
+int main(int argc, char* argv[])
+{
+ QApplication app(argc, argv);
+
+ MainWin win;
+ win.show();
+ return app.exec();
+}
+
diff --git a/examples/webkit/imageanalyzer/mainwindow.cpp b/examples/webkit/imageanalyzer/mainwindow.cpp
new file mode 100644
index 0000000..d89098e
--- /dev/null
+++ b/examples/webkit/imageanalyzer/mainwindow.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+#include "mainwindow.h"
+#include "imageanalyzer.h"
+
+#include <QWebFrame>
+#include <QWebElementCollection>
+#include <QNetworkDiskCache>
+
+/*
+ * Default Constructor
+ */
+//! [MainWindow - constructor]
+MainWin::MainWin(QWidget * parent) : QWebView(parent)
+{
+ m_network = new QNetworkAccessManager(this);
+ m_cache = new QNetworkDiskCache(this);
+ m_cache->setCacheDirectory(QDesktopServices::storageLocation(QDesktopServices::CacheLocation) + "/imageanalyzer");
+ m_cache->setMaximumCacheSize(1000000); //set the cache to 10megs
+ m_network->setCache(m_cache);
+ page()->setNetworkAccessManager(m_network);
+
+ //! The object we will expose to JavaScript engine:
+ m_analyzer = new ImageAnalyzer(m_cache, this);
+
+ // Signal is emitted before frame loads any web content:
+ QObject::connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()),
+ this, SLOT(addJSObject()));
+
+ // qrc:// URLs refer to resources. See imagenalayzer.qrc
+ QUrl startURL = QUrl("qrc:/index.html");
+
+ // Load web content now!
+ setUrl(startURL);
+}
+//! [MainWindow - constructor]
+
+//! [MainWindow - addJSObject]
+void MainWin::addJSObject() {
+ // Add pAnalyzer to JavaScript Frame as member "imageAnalyzer".
+ page()->mainFrame()->addToJavaScriptWindowObject(QString("imageAnalyzer"), m_analyzer);
+}
+//! [MainWindow - addJSObject]
diff --git a/examples/webkit/imageanalyzer/mainwindow.h b/examples/webkit/imageanalyzer/mainwindow.h
new file mode 100644
index 0000000..3c943dc
--- /dev/null
+++ b/examples/webkit/imageanalyzer/mainwindow.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 Nokia Corporation and its Subsidiary(-ies) 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$
+**
+****************************************************************************/
+
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QWebView>
+
+class ImageAnalyzer;
+QT_BEGIN_NAMESPACE
+class QNetworkDiskCache;
+QT_END_NAMESPACE
+
+class MainWin : public QWebView
+{
+ Q_OBJECT
+
+public:
+ explicit MainWin(QWidget * parent = 0);
+
+private:
+ ImageAnalyzer * m_analyzer;
+ QNetworkAccessManager * m_network;
+ QNetworkDiskCache * m_cache;
+
+private slots:
+ void addJSObject();
+
+};
+#endif
diff --git a/examples/webkit/imageanalyzer/resources/imageanalyzer.qrc b/examples/webkit/imageanalyzer/resources/imageanalyzer.qrc
new file mode 100644
index 0000000..fe9a5df
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/imageanalyzer.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>index.html</file>
+ <file>images/mtRainier.jpg</file>
+ <file>images/bellaCoola.jpg</file>
+ <file>images/trees.jpg</file>
+ <file>images/flower.jpg</file>
+ <file>images/seaShell.jpg</file>
+</qresource>
+</RCC>
diff --git a/examples/webkit/imageanalyzer/resources/images/README b/examples/webkit/imageanalyzer/resources/images/README
new file mode 100644
index 0000000..176a1da
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/images/README
@@ -0,0 +1,2 @@
+The images are under public domain and were obtained from
+http://publicdomainpictures.net
diff --git a/examples/webkit/imageanalyzer/resources/images/bellaCoola.jpg b/examples/webkit/imageanalyzer/resources/images/bellaCoola.jpg
new file mode 100644
index 0000000..f90ed54
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/images/bellaCoola.jpg
Binary files differ
diff --git a/examples/webkit/imageanalyzer/resources/images/flower.jpg b/examples/webkit/imageanalyzer/resources/images/flower.jpg
new file mode 100644
index 0000000..6b7f6be
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/images/flower.jpg
Binary files differ
diff --git a/examples/webkit/imageanalyzer/resources/images/mtRainier.jpg b/examples/webkit/imageanalyzer/resources/images/mtRainier.jpg
new file mode 100644
index 0000000..d09a3f2
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/images/mtRainier.jpg
Binary files differ
diff --git a/examples/webkit/imageanalyzer/resources/images/seaShell.jpg b/examples/webkit/imageanalyzer/resources/images/seaShell.jpg
new file mode 100644
index 0000000..c5005a9
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/images/seaShell.jpg
Binary files differ
diff --git a/examples/webkit/imageanalyzer/resources/images/trees.jpg b/examples/webkit/imageanalyzer/resources/images/trees.jpg
new file mode 100644
index 0000000..083b26d
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/images/trees.jpg
Binary files differ
diff --git a/examples/webkit/imageanalyzer/resources/index.html b/examples/webkit/imageanalyzer/resources/index.html
new file mode 100644
index 0000000..6532951
--- /dev/null
+++ b/examples/webkit/imageanalyzer/resources/index.html
@@ -0,0 +1,133 @@
+
+<html>
+ <body>
+ <!-- [ images list ] -->
+ <div style="float:right; width:50%; border-left: solid 1px black">
+ <div id="listdiv" align="center">
+ <h5>Images to be analyzed:</h5>
+ <select multiple size=10 id=imglist style="width:80%"></select>
+ <br />
+ <input type="button" id="evalbutton" value="Analyze" onclick="analyzeImages()" />
+ </div>
+ </div>
+ <!-- [ images list ] -->
+ <div style="width:50%">
+ <div id="titleblock" align="center">
+ <h2>Image Analyzer</h2>
+ </div>
+ <div id=outputdiv align=center>
+ <h4>Status: <span id=status>Idle</span></h4>
+ <h5>
+ Latest Results:<br />
+ Red: <span id=redval style="color:red">n/a</span><br />
+ Green: <span id=greenval style="color:green">n/a</span><br />
+ Blue: <span id=blueval style="color:blue">n/a</span><br />
+ </h5>
+ <h3>Click on images below to select for analysis</h3>
+ </div>
+ </div>
+ <!-- [ sample images ] -->
+ <div id=imagediv style="clear:both; text-align:center">
+ <hr/>
+ <img src="images/mtRainier.jpg" height=150px onclick='return addImage(this);' />
+ <img src="images/bellaCoola.jpg" height=150px onclick='return addImage(this);'/>
+ <img src="images/seaShell.jpg" height=150px onclick='return addImage(this);'/>
+ <!-- [ sample images ] -->
+ <img src="images/flower.jpg" height=150px onclick='return addImage(this);'/>
+ <img src="images/trees.jpg" height=150px onclick='return addImage(this);'/>
+ </div>
+
+ </body>
+</html>
+
+<script type="text/javascript">
+ var remaining = 0;
+ var connected = false;
+ //We use this function because connect statements resolve their target once, imediately
+ //not at signal emission so they must be connected once the imageAnalyzer object has been added to the frame
+ //! <!-- [ connect slots ] -->
+ function connectSlots()
+ {
+ if ( !connected ) {
+ connected = true;
+ imageAnalyzer.finishedAnalysis.connect(this, finished);
+ imageAnalyzer.updateProgress.connect(this, updateProg);
+ }
+ }
+ //! <!-- [ connect slots ] -->
+
+ function finished() {
+ setStatus('Idle');
+ setResults(imageAnalyzer.red.toFixed(2), imageAnalyzer.green.toFixed(2), imageAnalyzer.blue.toFixed(2));
+ }
+ //This will function as the recieving "slot" for the progress signal
+ function updateProg(complete, max)
+ {
+ var oldRemaining = remaining;
+ remaining = max - complete;
+ pullList(oldRemaining - remaining);
+ //Prevent results getting messed up if we don't get signals in order
+ if( imageAnalyzer.busy ) {
+ setStatus('Processing (' + complete + ' of ' + max + ' completed)');
+ setResults('Calculating','Calculating','Calculating');
+ }
+ }
+
+//! <!-- [ analyzeImages ] -->
+function analyzeImages() {
+ connectSlots();
+ var imglist = document.getElementsByTagName('option');
+ if (imglist.length > 0) {
+ stringlist = [];
+ for(var i=0; i<imglist.length; i++) {
+ stringlist[i]=imglist[i].value;
+ }
+ if (!imageAnalyzer.busy) {
+ remaining = stringlist.length;
+ imageAnalyzer.startAnalysis(stringlist);
+ } else {
+ alert("Processing, please wait until finished.");
+ }
+//! <!-- [ analyzeImages ] -->
+ } else {
+ alert('No images selected. Click on one or more images to select them for analysis.');
+ }
+}
+function clearList() {
+ var imglist = document.getElementById('imglist');
+ while(imglist.length > 0) {
+ imglist.removeChild(imglist.childNodes[0]);
+ }
+}
+function pullList(count) {
+ var imglist = document.getElementById('imglist');
+ while(imglist.length > 0 && count > 0) {
+ imglist.removeChild(imglist.childNodes[0]);
+ count--;
+ }
+}
+function setStatus(statusString) {
+ document.getElementById('status').innerHTML = statusString;
+}
+
+function setResults(red, green, blue) {
+ if (! isNaN(red) ) { red += " %"; }
+ if (! isNaN(green) ) { green += " %"; }
+ if (! isNaN(blue) ) { blue += " %"; }
+ document.getElementById('redval').innerHTML = red;
+ document.getElementById('greenval').innerHTML = green;
+ document.getElementById('blueval').innerHTML = blue;
+}
+//! <!-- [ addImage ] -->
+function addImage(newimg) {
+ var imglist = document.getElementById('imglist');
+ var curChildren = imglist.childNodes;
+ var newline = document.createElement('option');
+ newline.innerHTML = newimg.src.substring(newimg.src.lastIndexOf('/')+1);
+ newline.value = newimg.src;
+ imglist.appendChild(newline);
+}
+//! <!-- [ addImage ] -->
+</script>
+
+
diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro
index 76c8801..6a1d8f8 100644
--- a/examples/webkit/webkit.pro
+++ b/examples/webkit/webkit.pro
@@ -4,6 +4,7 @@ SUBDIRS += domtraversal \
previewer \
fancybrowser \
simpleselector \
+ imageanalyzer \
framecapture
contains(QT_CONFIG, openssl):SUBDIRS += googlechat
diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro
index 39c7ab2..48b2da9 100644
--- a/examples/widgets/icons/icons.pro
+++ b/examples/widgets/icons/icons.pro
@@ -17,7 +17,7 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince*: {
- imageFiles.sources = images/*
+ imageFiles.files = images/*
wincewm*: {
imageFiles.path = "/My Documents/My Pictures"
} else {
diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro
index 517fec7..d59bf2e 100644
--- a/examples/widgets/movie/movie.pro
+++ b/examples/widgets/movie/movie.pro
@@ -11,7 +11,7 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince*: {
- addFiles.sources += *.mng
+ addFiles.files += *.mng
addFiles.path = .
DEPLOYMENT += addFiles
DEPLOYMENT_PLUGIN += qmng
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index f906d2f..80bbec4 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -14,7 +14,7 @@ INSTALLS += target sources
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince*: {
- addFiles.sources = frank.xbel jennifer.xbel
+ addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
DEPLOYMENT += addFiles
}
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
index 5e9c8ca..94b3a07 100644
--- a/examples/xml/htmlinfo/htmlinfo.pro
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -2,7 +2,7 @@ SOURCES += main.cpp
QT -= gui
wince*|symbian:{
- htmlfiles.sources = *.html
+ htmlfiles.files = *.html
htmlfiles.path = .
DEPLOYMENT += htmlfiles
}
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index 7293bd1..d4b09b6 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -14,7 +14,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/xml/saxbookmarks
INSTALLS += target sources
wince*: {
- addFiles.sources = frank.xbel jennifer.xbel
+ addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
DEPLOYMENT += addFiles
}
@@ -22,7 +22,7 @@ wince*: {
symbian: {
TARGET.UID3 = 0xA000C60A
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
- addFiles.sources = frank.xbel jennifer.xbel
+ addFiles.files = frank.xbel jennifer.xbel
addFiles.path = /data/qt/saxbookmarks
DEPLOYMENT += addFiles
}