summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
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/qwidgets/qwidgets.pro2
-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/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/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
15 files changed, 126 insertions, 18 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 7149986..f6e09a2 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/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
index 2e610f9..0f5398b 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/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/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/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
}