summaryrefslogtreecommitdiff
path: root/doc/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-08-12 09:42:51 +1000
committerMichael Brasser <michael.brasser@nokia.com>2011-08-12 09:42:51 +1000
commit72c58996a5fc7c7a1a82fefa5a0034f57383e788 (patch)
treecde90f301afe3783f95a683dc0a54d31aafb673e /doc/src/declarative
parenteb5fae761ff2aaf3d35245ac1f9d1ea10c4e84bb (diff)
parentc7b8fdf5d866b5202dada00ba175606807f69fca (diff)
downloadqt4-tools-72c58996a5fc7c7a1a82fefa5a0034f57383e788.tar.gz
Merge branch 'master' of ../qt-qml-staging
Diffstat (limited to 'doc/src/declarative')
-rw-r--r--doc/src/declarative/declarativeui.qdoc10
-rw-r--r--doc/src/declarative/elements.qdoc13
-rw-r--r--doc/src/declarative/examples.qdoc23
-rw-r--r--doc/src/declarative/pics/shaderexample.pngbin0 -> 3941 bytes
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc81
-rw-r--r--doc/src/declarative/qtbinding.qdoc34
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc2
-rw-r--r--doc/src/declarative/qtquick-intro.qdoc2
-rw-r--r--doc/src/declarative/righttoleft.qdoc11
-rw-r--r--doc/src/declarative/whatsnew.qdoc52
10 files changed, 165 insertions, 63 deletions
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index 56ab29f618..cecccf6254 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -46,7 +46,7 @@ Qt applications.
\section1 Getting Started
\list
-\o \l{Intro to Qt Quick}{Introduction to Qt Quick}
+\o \l{Introduction to Qt Quick}
\o \l{QML for Qt Programmers}{QML Programming for Qt Programmers}
\o \l{Getting Started Programming with QML}
@@ -147,4 +147,12 @@ examples for porting}
\list
\o \l{Qt Quick Licensing Information}
\endlist
+
+\section1 Online Examples
+
+\list
+\o Forum Nokia:
+\l{http://wiki.forum.nokia.com/index.php/Qt_Quick_examples_for_porting}{Qt Quick
+examples for porting}
+\endlist
*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index a861a66a58..6b7a5fc8f0 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -175,6 +175,8 @@ Elements that animate properties based on data types
\o \l {ParticleMotionLinear} - Adds linear motion behavior to \l {Particles}
\o \l {ParticleMotionGravity} - Adds gravitational motion to \l {Particles}
\o \l {ParticleMotionWander} - Adds varied motions to \l {Particles}
+\o \l {ShaderEffectItem} - Enables the use of OpenGL Shading Language together with QML
+\o \l {ShaderEffectSource} - Encapsulates QML item tree as a source item for \l {ShaderEffectItem}
\endlist
\section1 Add-On Elements
@@ -321,3 +323,14 @@ should first be obtained and installed.
\generatelist{related}
*/
+
+/*!
+ \group qml-shader-elements
+ \title QML Shader Elements
+ \ingroup qml-groups
+
+ \brief Elements for using OpenGL shading language code together with the QML code.
+
+ \generatelist{related}
+
+*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 0e325e2f38..1003b2269b 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -33,7 +33,7 @@
Qt includes a set of examples and demos that show how to use various aspects
-of QML. The examples are small demonstrations of particular QML components,
+of QML. The examples are small demonstrations of particular QML components,
while the demos contain more complete and functional applications.
To run the examples and demos, open them in Qt Creator or use the included
@@ -60,43 +60,43 @@ can be used to produce sophisticated interfaces and applications:
\table
\row
-\o
+\o
\l{demos/declarative/calculator}{Calculator}
\image qml-calculator-example-small.png
-\o
+\o
\l{demos/declarative/flickr}{Flickr Mobile}
\image qml-flickr-demo-small.png
-\o
+\o
\l{demos/declarative/minehunt}{Minehunt}
\image qml-minehunt-demo-small.png
\row
-\o
+\o
\l{demos/declarative/photoviewer}{Photo Viewer}
\image qml-photoviewer-demo-small.png
-\o
+\o
\l{demos/declarative/rssnews}{RSS News Reader}
\image qml-rssnews-demo-small.png
-\o
+\o
\l{demos/declarative/samegame}{Same Game}
\image qml-samegame-demo-small.png
\row
-\o
+\o
\l{demos/declarative/snake}{Snake}
\image qml-snake-demo-small.png
-\o
+\o
\l{demos/declarative/twitter}{Twitter}
\image qml-twitter-demo-small.png
-\o
+\o
\l{demos/declarative/webbrowser}{Web Browser}
\image qml-webbrowser-demo-small.png
@@ -109,7 +109,7 @@ The demos can be found in Qt's \c demos/declarative directory.
The QML examples are small, simple applications that show how to use a particular
QML component or feature. If you are new
-to QML, you may also find the \l{QML Tutorial}{Hello World} and
+to QML, you may also find the \l{QML Tutorial}{Hello World} and
\l {QML Advanced Tutorial}{Same Game} tutorials useful.
The examples can be found in Qt's \c examples/declarative directory.
@@ -234,6 +234,7 @@ The examples can be found in Qt's \c examples/declarative directory.
\list
\o \l{src/imports/folderlistmodel}{Folder List Model} - a C++ model plugin
+\o \l{declarative/shadereffects}{Shader Effects}
\endlist
*/
diff --git a/doc/src/declarative/pics/shaderexample.png b/doc/src/declarative/pics/shaderexample.png
new file mode 100644
index 0000000000..dbc7291aac
--- /dev/null
+++ b/doc/src/declarative/pics/shaderexample.png
Binary files differ
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index 52ece6f5b4..36db62862e 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -422,3 +422,84 @@ a function in the model, e.g.:
updated, and that \e{value} holds the new value.
*/
+
+/*!
+\page qml-presenting-data.html
+\title Presenting Data with QML
+
+\section1 Introduction
+
+Qt Quick contains a set of standard items that can be used to present data in a
+number of different ways. For simple user interfaces,
+\l{Using QML Positioner and Repeater Items#Repeaters}{Repeaters} can be used
+in combination with
+\l{Using QML Positioner and Repeater Items#Positioners}{Positioners}
+to obtain pieces of data and arrange them in a user interface. However, when
+large quantities of data are involved, it is often better to use models with
+the standard views since these contain many built-in display and navigation
+features.
+
+\section1 Views
+
+Views are scrolling containers for collections of items. They are feature-rich,
+supporting many of the use cases found in typical applications, and can be
+customized to meet requirements on style and behavior.
+
+A set of standard views are provided in the basic set of Qt Quick
+graphical elements:
+
+\list
+\o \l{#ListView}{ListView} arranges items in a horizontal or vertical list
+\o \l{#GridView}{GridView} arranges items in a grid within the available space
+\o \l{#PathView}{PathView} arranges items on a path
+\endlist
+
+Unlike these items, \l WebView is not a fully-featured view item, and needs
+to be combined with a \l Flickable item to create a view that performs like
+a Web browser.
+
+\section2 ListView
+
+\l ListView shows a classic list of items with horizontal or vertical placing
+of items.
+
+\beginfloatright
+\inlineimage qml-listview-snippet.png
+\endfloat
+
+The following example shows a minimal ListView displaying a sequence of
+numbers (using an \l{QML Data Models#An Integer}{integer as a model}).
+A simple delegate is used to define an items for each piece of data in the
+model.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/listview/listview-snippet.qml document
+
+
+
+\section2 GridView
+
+\l GridView displays items in a grid like an file manager's icon view.
+
+\section2 PathView
+
+\l PathView displays items on a path, where the selection remains in
+the same place and the items move around it.
+
+\section1 Decorating Views
+
+\section2 Headers and Footers
+
+\section2 Sections
+
+\section2 Navigation
+
+In traditional user interfaces, views can be scrolled using standard
+controls, such as scroll bars and arrow buttons. In some situations, it
+is also possible to drag the view directly by pressing and holding a
+mouse button while moving the cursor. In touch-based user interfaces,
+this dragging action is often complemented with a flicking action, where
+scrolling continues after the user has stopped touching the view.
+
+\section1 Further Reading
+*/
diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc
index b35ddc59e1..e34272861a 100644
--- a/doc/src/declarative/qtbinding.qdoc
+++ b/doc/src/declarative/qtbinding.qdoc
@@ -108,7 +108,7 @@ These methods are shown below. Naturally these approaches are not exclusive; you
these methods throughout your application as appropriate.
-\section2 Loading QML components from C++
+\section2 Loading QML Components from C++
A QML document can be loaded with QDeclarativeComponent or QDeclarativeView. QDeclarativeComponent
loads a QML component as a C++ object; QDeclarativeView also does this,
@@ -180,7 +180,7 @@ required \c objectName. It is better for the C++ implementation to know as littl
the QML user interface implementation and the composition of the QML object tree.
-\section2 Embedding C++ objects into QML components
+\section2 Embedding C++ Objects into QML Components
When loading a QML scene into a C++ application, it can be useful to directly embed C++ data into
the QML object. QDeclarativeContext enables this by exposing data to the context of a QML
@@ -231,7 +231,7 @@ in QML views.
Also see the QDeclarativeContext documentation for more information.
-\section2 Defining new QML elements
+\section2 Defining New QML Elements
While new QML elements can be \l {Defining New Components}{defined in QML}, they can also be
defined by C++ classes; in fact, many of the core \l {QML Elements} are implemented through
@@ -270,7 +270,7 @@ For more information on defining new QML elements, see the \l {Tutorial: Writing
-\section1 Exchanging data between QML and C++
+\section1 Exchanging Data between QML and C++
QML and C++ objects can communicate with one another through signals, slots and property
modifications. For a C++ object, any data that is exposed to Qt's \l{The Meta-Object System}{Meta-Object System}
@@ -279,7 +279,7 @@ the QML side, all QML object data is automatically made available to the meta-ob
be accessed from C++.
-\section2 Calling functions
+\section2 Calling Functions
QML functions can be called from C++ and vice-versa.
@@ -314,7 +314,7 @@ same name but different arguments, the correct function will be called according
the types of arguments that are provided.
-\section2 Receiving signals
+\section2 Receiving Signals
All QML signals are automatically available to C++, and can be connected to using QObject::connect()
like any ordinary Qt C++ signal. In return, any C++ signal can be received by a QML object using
@@ -373,7 +373,7 @@ class that is emitting the signal, and that the enum is registered using Q_ENUMS
See \l {Using enumerations of a custom type} below for details.
-\section2 Modifying properties
+\section2 Modifying Properties
Any properties declared in a QML object are automatically accessible from C++. Given a QML item
like this:
@@ -454,7 +454,7 @@ To allow a custom C++ type to be created or used in QML, the C++ class must be r
type using qmlRegisterType(), as shown in the \l {Defining new QML elements} section above.
-\section2 JavaScript arrays and objects
+\section2 JavaScript Arrays and Objects
There is built-in support for automatic type conversion between QVariantList and JavaScript
arrays, and QVariantMap and JavaScript objects.
@@ -465,6 +465,10 @@ below right calls this function, passing a QVariantList and a QVariantMap, which
converted to JavaScript array and object values, repectively:
\table
+\header
+\o Type
+\o String format
+\o Example
\row
\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml 0
\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp 0
@@ -485,7 +489,7 @@ parameter, the value can be created as a JavaScript array or object in the QML
side, and is automatically converted to a QVariantList or QVariantMap when it is passed to C++.
-\section2 Using enumerations of a custom type
+\section2 Using Enumerations of a Custom Type
To use an enumeration from a custom C++ component, the enumeration must be declared with Q_ENUMS() to
register it with Qt's meta object system. For example, the following C++ type has a \c Status enum:
@@ -507,22 +511,26 @@ the \l {Extending QML Functionalities using C++} reference documentation for
more information.
-\section2 Using enumeration values as signal parameters
+\section2 Using Enumeration Values as Signal and Method Parameters
C++ signals may pass enumeration values as signal parameters to QML, providing that the enumeration
and the signal are declared within the same class, or that the enumeration value is one of those declared
in the \l {Qt}{Qt Namespace}.
+Likewise, invokable C++ methods parameters may be enumeration values providing that the enumeration and
+the method are declared within the same class, or that the enumeration value is one of those declared in the
+\l {Qt}{Qt Namespace}.
+
Additionally, if a C++ signal with an enum parameter should be connectable to a QML function using the
-\l {Connecting signals to methods and other signals}{connect()} function, the enum type must be
-registered using qRegisterMetaType().
+\l{QML Signal and Handler Event System#Connecting Signals to Methods and Signals}{connect()}
+function, the enum type must be registered using qRegisterMetaType().
For QML signals, enum values may be used as signal parameters using the \c int type:
\snippet doc/src/snippets/declarative/qtbinding/enums/standalone.qml 1
-\section2 Automatic type conversion from strings
+\section2 Automatic Type Conversion from Strings
As a convenience, some basic types can be specified in QML using format strings to make it easier to
pass simple values from QML to C++.
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 027bb2eb10..75420d5172 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -210,4 +210,4 @@
#include <QtDeclarative> to use this function.
Returns the QML type id.
- */
+*/
diff --git a/doc/src/declarative/qtquick-intro.qdoc b/doc/src/declarative/qtquick-intro.qdoc
index bdad2c3047..4cd5db3867 100644
--- a/doc/src/declarative/qtquick-intro.qdoc
+++ b/doc/src/declarative/qtquick-intro.qdoc
@@ -27,7 +27,7 @@
/*!
\page qml-intro.html
-\title Intro to Qt Quick
+\title Introduction to Qt Quick
Qt Quick is a collection of technologies that are designed to help developers
create the kind of intuitive, modern, and fluid user interfaces that are
diff --git a/doc/src/declarative/righttoleft.qdoc b/doc/src/declarative/righttoleft.qdoc
index 44277983b4..1f2cd08352 100644
--- a/doc/src/declarative/righttoleft.qdoc
+++ b/doc/src/declarative/righttoleft.qdoc
@@ -64,8 +64,7 @@ This default locale-based alignment can be overriden by setting the \c horizonta
property for the text element, or by enabling layout mirroring using the \l LayoutMirroring attached
property, which causes any explicit left and right horizontal alignments to be mirrored.
Note that when \l LayoutMirroring is set, the \c horizontalAlignment property value remains unchanged;
-the effective alignment of the text element that takes the mirroring into account can be read from the
-\c effectiveHorizontalAlignment property.
+use the property \c LayoutMirroring.enabled instead to query whether the mirroring is in effect.
\snippet doc/src/snippets/declarative/righttoleft.qml 0
@@ -79,9 +78,9 @@ property for controlling the horizontal direction of the layouts. Setting \c lay
the left-to-right layout direction.
The horizontal layout direction can also be reversed through the \l LayoutMirroring attached property.
-This causes the effective \c layoutDirection of positioners and views to be mirrored. Note the actual value
-of the \c layoutDirection property will remain unchanged; the effective layout direction of positioners and
-views that takes the mirroring into account can be read from the \c effectiveLayoutDirection property.
+This causes the effective \c layoutDirection of positioners and views to be mirrored. Note though that the actual
+value of the \c layoutDirection property will remain unchanged; use the property \c LayoutMirroring.enabled instead
+to query whether the mirroring is in effect.
\snippet doc/src/snippets/declarative/righttoleft.qml 1
@@ -106,7 +105,7 @@ Applying mirroring in this manner does not change the actual value of the releva
direction of positioners and model views that takes the mirroring into account. Similarly the \l Text,
\l TextInput and \l TextEdit elements have gained the read-only property \c effectiveHorizontalAlignment
for querying the effective visual alignment of text. For anchors, the read only
-\l {Item::anchors}{anchors.mirrored} property reflects whether anchors have been mirrored.
+\l {Item::anchors.top}{anchors.mirrored} property reflects whether anchors have been mirrored.
Note that application layouts and animations that are defined using \l {Item::}{x} property values (as
opposed to anchors or positioner elements) are not affected by the \l LayoutMirroring attached property.
diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc
index 9e13e98459..3a78f1b3bf 100644
--- a/doc/src/declarative/whatsnew.qdoc
+++ b/doc/src/declarative/whatsnew.qdoc
@@ -26,12 +26,13 @@
****************************************************************************/
/*!
-\title What's new in Qt Quick
+\title What's New in Qt Quick
\page qtquick-whatsnew.html
\section1 Qt 4.7.4 includes QtQuick 1.1
-QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new features.
+QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new
+features.
\section2 PinchArea
@@ -39,14 +40,9 @@ PinchArea provides support for the common two finger pinch gesture.
\section2 LayoutMirroring attached property
-\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both left-to-right and right-to-left layout versions of your application that target different language areas.
-
-\section2 Anchors
-
-Added the following property:
-\list
-\o \l {Item::}{anchors.mirrored}
-\endlist
+\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both
+left-to-right and right-to-left layout versions of your application that target
+different language areas.
\section2 Text
@@ -57,7 +53,6 @@ Added the following properties:
\o \l {Text::}{lineCount}
\o \l {Text::}{maximumLineCount}
\o \l {Text::}{truncated}
-\o \l {Text::}{effectiveHorizontalAlignment}
\endlist
horizontalAlignment now accepts Text.AlignJustify alignment mode.
@@ -70,7 +65,6 @@ Added the following properties, methods and signal handlers:
\o \l {TextEdit::}{lineCount}
\o \l {TextEdit::}{inputMethodComposing}
\o \l {TextEdit::}{mouseSelectionMode}
-\o \l {TextEdit::}{effectiveHorizontalAlignment}
\o \l {TextEdit::}{deselect()}
\o \l {TextEdit::}{isRightToLeft()}
\o \l {TextEdit::}{moveCursorSelection()} to enable selection by word
@@ -84,7 +78,6 @@ Added the following properties and methods:
\o \l {TextInput::}{canPaste}
\o \l {TextInput::}{inputMethodComposing}
\o \l {TextInput::}{mouseSelectionMode}
-\o \l {TextInput::}{effectiveHorizontalAlignment}
\o \l {TextInput::}{deselect()}
\o \l {TextInput::}{isRightToLeft()}
\o \l {TextInput::}{moveCursorSelection()} to enable selection by word
@@ -125,17 +118,15 @@ Added the following property:
Added the following properties and methods:
\list
\o \l{ListView::}{layoutDirection}
-\o \l{ListView::}{effectiveLayoutDirection}
\o \l{ListView::}{positionViewAtBeginning()}
\o \l{ListView::}{positionViewAtEnd()}
\endlist
\section2 Flow, Grid and Row
-Added the following properties:
+Added the following property:
\list
\o \l{Flow::}{layoutDirection}
-\o \l{Flow::}{effectiveLayoutDirection}
\endlist
\section2 Repeater
@@ -150,21 +141,21 @@ Added the following methods and signal handlers:
\section2 Component
\list
-\o The \l{Component::}{createObject()} method now accepts a map of initial property values for
-the created object.
+\o The \l{Component::}{createObject()} method now accepts a map of initial
+property values for the created object.
\endlist
\section2 Qt
\list
-\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic global application
-properties.
+\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic
+global application properties.
\endlist
\section2 Other changes
\list
-\o Functions can be \l{Binding Properties from JavaScript}{assigned to properties from JavaScript}
+\o Functions can be \l{Property Binding#Property Binding}{assigned to properties from JavaScript}
to create property bindings.
\o QtQuick now supports Right to Left layout in positioners, views, anchors and text elements.
\endlist
@@ -174,13 +165,14 @@ to create property bindings.
\section2 QtQuick namespace
-In prior Qt releases, all the Qt Quick elements were available in the \e Qt namespace.
-Starting with Qt 4.7.1, the elements are also available in the \e QtQuick namespace,
-which improves naming consistency, and allows the development of Qt Quick to occur at
-a faster rate than Qt's usual minor release schedule.
+In prior Qt releases, all the Qt Quick elements were available in the \e Qt
+namespace. Starting with Qt 4.7.1, the elements are also available in the
+\e QtQuick namespace, which improves naming consistency, and allows the
+development of Qt Quick to occur at a faster rate than Qt's usual minor release
+schedule.
-The change for developers is very simple - where you previously wrote \e {import Qt 4.7},
-just replace it with \e {import QtQuick 1.0}, like this:
+The change for developers is very simple - where you previously wrote
+\e {import Qt 4.7}, just replace it with \e {import QtQuick 1.0}, like this:
\code
import QtQuick 1.0
@@ -190,7 +182,7 @@ Text {
}
\endcode
-\e {import Qt 4.7} continues to work so existing applications wont break even if they
-aren't updated, but it is recommended that all import statements be modified to the new
-form.
+\e {import Qt 4.7} continues to work so existing applications won't break even
+if they aren't updated, but it is recommended that all import statements be
+modified to the new form.
*/