diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-05-26 00:38:06 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-05-26 00:38:06 (GMT) |
commit | 3d34201d34ba26530025d5ff88fa6e498ae6f800 (patch) | |
tree | 490263b773db802c4dcf9355ef789e3e19c9cf0f /doc/src | |
parent | 96f47aeec086b2d35b859194e42721dbc2d2db6a (diff) | |
parent | 291dce4ceba88a6cada0415524e3466621ac1612 (diff) | |
download | Qt-3d34201d34ba26530025d5ff88fa6e498ae6f800.zip Qt-3d34201d34ba26530025d5ff88fa6e498ae6f800.tar.gz Qt-3d34201d34ba26530025d5ff88fa6e498ae6f800.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Conflicts:
examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml
Diffstat (limited to 'doc/src')
33 files changed, 177 insertions, 22 deletions
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 5283ba8..1199b26 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -98,7 +98,7 @@ application or to build completely new applications. QML is fully \l \o \l {qdeclarativemodules.html}{Modules} \o \l {qdeclarativefocus.html}{Keyboard Focus} \o \l {Extending types from QML} -\o \l {Dynamic Object Creation} +\o \l {qdeclarativedynamicobjects.html}{Dynamic Object Creation} \o \l {qmlruntime.html}{The Qt Declarative Runtime} \endlist diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc index 2688ee5..633489b 100644 --- a/doc/src/declarative/dynamicobjects.qdoc +++ b/doc/src/declarative/dynamicobjects.qdoc @@ -75,12 +75,12 @@ the parent later you can safely pass null to this function. Here is an example. Here is a \c Sprite.qml, which defines a simple QML component: -\quotefile doc/src/snippets/declarative/Sprite.qml +\snippet doc/src/snippets/declarative/Sprite.qml 0 Our main application file, \c main.qml, imports a \c componentCreation.js JavaScript file that will create \c Sprite objects: -\quotefile doc/src/snippets/declarative/createComponent.qml +\snippet doc/src/snippets/declarative/createComponent.qml 0 Here is \c componentCreation.js. Remember that QML files that might be loaded over the network cannot be expected to be ready immediately: diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index a355f9f..6e0426c 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -56,17 +56,17 @@ sub-directory that show how to use various aspects of QML. In addition, the applications. These demos are intended to show integrated functionality rather than being instructive on specific elements. -To run the examples and demos, you can use Qt Creator or the included \l {Qt Declarative UI Runtime}{qml} +To run the examples and demos, you can use Qt Creator or the included \l {Qt Declarative UI Runtime}{qmlviewer} command-line application. It has some useful options, revealed by: \code - bin/qml -help + bin/qmlviewer -help \endcode For example, from your build directory, run: \code - bin/qml $QTDIR/demos/declarative/samegame/samegame.qml + bin/qmlviewer $QTDIR/demos/declarative/samegame/samegame.qml \endcode \section1 Examples diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc index c2237d6..56ba1c7 100644 --- a/doc/src/examples/qml-examples.qdoc +++ b/doc/src/examples/qml-examples.qdoc @@ -271,6 +271,8 @@ This example displays a set of clocks with different times for different cities. Each clock is created by combining \l Image elements with \l Rotation transforms and \l SpringFollow animations. + + \image qml-clocks-example.png */ /*! @@ -280,14 +282,8 @@ This example presents a flickable set of interactive corkboards. It is created through a combination of elements like \l ListModel, \l Repeater and \l TextEdit together with rotation and scaling transforms, animation and mouse interaction. -*/ - -/*! - \title Toys: Dial - \example declarative/toys/dial - This example presents an interactive speedometer-type dial by combining - \l Image elements with \l Rotation transforms and \l SpringFollow animations. + \image qml-corkboards-example.png */ /*! @@ -297,6 +293,8 @@ This example presents an interactive drag-and-drop scene. It demonstrates how to use QML's \l{Dynamic Object Creation} support to dynamically create and destroy objects. + + \image qml-dynamicscene-example.png */ /*! @@ -304,6 +302,8 @@ \example declarative/toys/tic-tac-toe This example presents a simple implementation of Tic Tac Toe. + + \image qml-tic-tac-toe-example.png */ /*! @@ -312,6 +312,8 @@ This example shows how to use animation components such as \l SpringFollow, \l SequentialAnimation and \l PropertyAction to create a game of TV tennis. + + \image qml-tvtennis-example.png */ /*! @@ -329,10 +331,23 @@ */ /*! + \title UI Components: Dial + \example declarative/ui-components/dialcontrol + + This example presents an interactive speedometer-type dial by combining + \l Image elements with \l Rotation transforms and \l SpringFollow animations. + + \image qml-dialcontrol-example.png +*/ + + +/*! \title UI Components: Flipable \example declarative/ui-components/flipable This example shows how to use the Flipable element. + + \image qml-flipable-example.png */ /*! @@ -340,6 +355,8 @@ \example declarative/ui-components/progressbar This example shows how to create a progress bar. + + \image qml-progressbar-example.png */ /*! @@ -349,6 +366,8 @@ This example shows how to create scroll bars for a Flickable element using the \l {Flickable::visibleArea.xPosition}{Flickable::visibleArea} properties. + + \image qml-scrollbar-example.png */ /*! @@ -356,6 +375,8 @@ \example declarative/ui-components/searchbox This example shows how to create a search box. + + \image qml-searchbox-example.png */ /*! @@ -363,6 +384,8 @@ \example declarative/ui-components/slideswitch This example shows how to create a slide switch. + + \image qml-slideswitch-example.png */ /*! @@ -370,6 +393,8 @@ \example declarative/ui-components/spinner This example shows how to create a spinner-type component. + + \image qml-spinner-example.png */ /*! @@ -377,6 +402,8 @@ \example declarative/ui-components/tabwidget This example shows how to create a tab widget. + + \image qml-tabwidget-example.png */ /*! diff --git a/doc/src/examples/qml-flickr.qdoc b/doc/src/examples/qml-flickr.qdoc index ebf3250..43fcf1f 100644 --- a/doc/src/examples/qml-flickr.qdoc +++ b/doc/src/examples/qml-flickr.qdoc @@ -45,5 +45,5 @@ This demo shows how to write a mobile Flickr browser application in QML. - \image qml-flickr-example.png + \image qml-flickr-demo.png */ diff --git a/doc/src/examples/qml-minehunt.qdoc b/doc/src/examples/qml-minehunt.qdoc index 773f216..b2c662d 100644 --- a/doc/src/examples/qml-minehunt.qdoc +++ b/doc/src/examples/qml-minehunt.qdoc @@ -43,7 +43,8 @@ \title Minehunt \example demos/declarative/minehunt - This demo shows how to create a simple Minehunt game with QML and C++. + This demo shows how to create a simple Minehunt game, using QML for the + UI and a C++ plugin for the game logic. - \image qml-minehunt-example.png + \image qml-minehunt-demo.png */ diff --git a/doc/src/examples/qml-photoviewer.qdoc b/doc/src/examples/qml-photoviewer.qdoc index d1c3da2..d2114b9 100644 --- a/doc/src/examples/qml-photoviewer.qdoc +++ b/doc/src/examples/qml-photoviewer.qdoc @@ -45,5 +45,5 @@ This demo shows how to write a Flickr photo viewer application in QML. - \image qml-photoviewer-example.png + \image qml-photoviewer-demo.png */ diff --git a/doc/src/examples/qml-rssnews.qdoc b/doc/src/examples/qml-rssnews.qdoc index 0e7bdef..801efd9 100644 --- a/doc/src/examples/qml-rssnews.qdoc +++ b/doc/src/examples/qml-rssnews.qdoc @@ -45,5 +45,5 @@ This demo shows how to write a RSS news reader in QML. - \image qml-rssnews-example.png + \image qml-rssnews-demo.png */ diff --git a/doc/src/examples/qml-samegame.qdoc b/doc/src/examples/qml-samegame.qdoc index d9a9c7c..5b78b0c 100644 --- a/doc/src/examples/qml-samegame.qdoc +++ b/doc/src/examples/qml-samegame.qdoc @@ -43,7 +43,8 @@ \title Same Game \example demos/declarative/samegame - This demo shows how to write a Same Game in QML. + This demo shows how to write a 'Same Game' game in QML, using Javascript + for all the game logic. - \image qml-samegame-example.png + \image qml-samegame-demo.png */ diff --git a/doc/src/examples/qml-snake.qdoc b/doc/src/examples/qml-snake.qdoc index 373ca13..3125f2d 100644 --- a/doc/src/examples/qml-snake.qdoc +++ b/doc/src/examples/qml-snake.qdoc @@ -43,7 +43,8 @@ \title Snake \example demos/declarative/snake - This demo shows how to write a Snake game in QML. + This demo shows how to write a Snake game in QML, controlled by the + keyboard as well as the mouse. - \image qml-snake-example.png + \image qml-snake-demo.png */ diff --git a/doc/src/examples/qml-twitter.qdoc b/doc/src/examples/qml-twitter.qdoc new file mode 100644 index 0000000..0e66360 --- /dev/null +++ b/doc/src/examples/qml-twitter.qdoc @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** 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 documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title Twitter Mobile + \example demos/declarative/twitter + + This demo shows how to write a mobile Twitter client in QML. Use it to + tweet us(@qtbynokia) how much you like our demos! + + \image qml-twitter-demo.png +*/ diff --git a/doc/src/images/qml-clocks-example.png b/doc/src/images/qml-clocks-example.png Binary files differnew file mode 100644 index 0000000..1b352b5 --- /dev/null +++ b/doc/src/images/qml-clocks-example.png diff --git a/doc/src/images/qml-corkboards-example.png b/doc/src/images/qml-corkboards-example.png Binary files differnew file mode 100644 index 0000000..8acffa7 --- /dev/null +++ b/doc/src/images/qml-corkboards-example.png diff --git a/doc/src/images/qml-dialcontrol-example.png b/doc/src/images/qml-dialcontrol-example.png Binary files differnew file mode 100644 index 0000000..74cd645 --- /dev/null +++ b/doc/src/images/qml-dialcontrol-example.png diff --git a/doc/src/images/qml-dynamicscene-example.png b/doc/src/images/qml-dynamicscene-example.png Binary files differnew file mode 100644 index 0000000..1f725d1 --- /dev/null +++ b/doc/src/images/qml-dynamicscene-example.png diff --git a/doc/src/images/qml-flickr-example.png b/doc/src/images/qml-flickr-demo.png Binary files differindex 71ea567..71ea567 100644 --- a/doc/src/images/qml-flickr-example.png +++ b/doc/src/images/qml-flickr-demo.png diff --git a/doc/src/images/qml-flipable-example.png b/doc/src/images/qml-flipable-example.png Binary files differnew file mode 100644 index 0000000..dd68a66 --- /dev/null +++ b/doc/src/images/qml-flipable-example.png diff --git a/doc/src/images/qml-minehunt-example.png b/doc/src/images/qml-minehunt-demo.png Binary files differindex 3b69569..3b69569 100644 --- a/doc/src/images/qml-minehunt-example.png +++ b/doc/src/images/qml-minehunt-demo.png diff --git a/doc/src/images/qml-photoviewer-example.png b/doc/src/images/qml-photoviewer-demo.png Binary files differindex be6f1bf..be6f1bf 100644 --- a/doc/src/images/qml-photoviewer-example.png +++ b/doc/src/images/qml-photoviewer-demo.png diff --git a/doc/src/images/qml-progressbar-example.png b/doc/src/images/qml-progressbar-example.png Binary files differnew file mode 100644 index 0000000..3ddd6c6 --- /dev/null +++ b/doc/src/images/qml-progressbar-example.png diff --git a/doc/src/images/qml-rssnews-example.png b/doc/src/images/qml-rssnews-demo.png Binary files differindex 948ef4d..948ef4d 100644 --- a/doc/src/images/qml-rssnews-example.png +++ b/doc/src/images/qml-rssnews-demo.png diff --git a/doc/src/images/qml-samegame-example.png b/doc/src/images/qml-samegame-demo.png Binary files differindex c17b4e0..c17b4e0 100644 --- a/doc/src/images/qml-samegame-example.png +++ b/doc/src/images/qml-samegame-demo.png diff --git a/doc/src/images/qml-searchbox-example.png b/doc/src/images/qml-searchbox-example.png Binary files differnew file mode 100644 index 0000000..97d12bb --- /dev/null +++ b/doc/src/images/qml-searchbox-example.png diff --git a/doc/src/images/qml-slideswitch-example.png b/doc/src/images/qml-slideswitch-example.png Binary files differnew file mode 100644 index 0000000..17cb3eb --- /dev/null +++ b/doc/src/images/qml-slideswitch-example.png diff --git a/doc/src/images/qml-snake-example.png b/doc/src/images/qml-snake-demo.png Binary files differindex d3c077d..d3c077d 100644 --- a/doc/src/images/qml-snake-example.png +++ b/doc/src/images/qml-snake-demo.png diff --git a/doc/src/images/qml-spinner-example.png b/doc/src/images/qml-spinner-example.png Binary files differnew file mode 100644 index 0000000..ed381f8 --- /dev/null +++ b/doc/src/images/qml-spinner-example.png diff --git a/doc/src/images/qml-tabwidget-example.png b/doc/src/images/qml-tabwidget-example.png Binary files differnew file mode 100644 index 0000000..05887f3 --- /dev/null +++ b/doc/src/images/qml-tabwidget-example.png diff --git a/doc/src/images/qml-tic-tac-toe-example.png b/doc/src/images/qml-tic-tac-toe-example.png Binary files differnew file mode 100644 index 0000000..5a5cc82 --- /dev/null +++ b/doc/src/images/qml-tic-tac-toe-example.png diff --git a/doc/src/images/qml-tvtennis-example.png b/doc/src/images/qml-tvtennis-example.png Binary files differnew file mode 100644 index 0000000..ac2b527 --- /dev/null +++ b/doc/src/images/qml-tvtennis-example.png diff --git a/doc/src/images/qml-twitter-demo.png b/doc/src/images/qml-twitter-demo.png Binary files differnew file mode 100644 index 0000000..63d6486 --- /dev/null +++ b/doc/src/images/qml-twitter-demo.png diff --git a/doc/src/snippets/declarative/Sprite.qml b/doc/src/snippets/declarative/Sprite.qml index b306cb0..5f32b0a 100644 --- a/doc/src/snippets/declarative/Sprite.qml +++ b/doc/src/snippets/declarative/Sprite.qml @@ -39,6 +39,8 @@ ** ****************************************************************************/ +//![0] import Qt 4.7 Rectangle { width: 80; height: 50; color: "red" } +//![0] diff --git a/doc/src/snippets/declarative/createComponent.qml b/doc/src/snippets/declarative/createComponent.qml index 910ea95..3686188 100644 --- a/doc/src/snippets/declarative/createComponent.qml +++ b/doc/src/snippets/declarative/createComponent.qml @@ -39,6 +39,7 @@ ** ****************************************************************************/ +//![0] import Qt 4.7 import "componentCreation.js" as MyModule @@ -48,3 +49,4 @@ Rectangle { Component.onCompleted: MyModule.createSpriteObjects(); } +//![0] diff --git a/doc/src/snippets/declarative/texteditor.qml b/doc/src/snippets/declarative/texteditor.qml new file mode 100644 index 0000000..0bd79b5 --- /dev/null +++ b/doc/src/snippets/declarative/texteditor.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** 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:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 + +//![0] +Flickable { + id: flick + + width: 300; height: 200; + contentHeight: edit.height + clip: true + + 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: edit + width: parent.width + focus: true + wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere + onCursorRectangleChanged: flick.ensureVisible(cursorRectangle) + } +} +//![0] |