summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-17 05:15:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-17 05:15:57 (GMT)
commitf60eeb5c165d5b9e5998edae7785cc893a613bca (patch)
tree13997c6ce889b1e51dd159c016437503a094a7e5 /doc
parentbdbe09ad2c01ae11d10511b51f8d7a3dfb27b17c (diff)
parent7a738662838763e4828c6ac8957a2823b095f566 (diff)
downloadQt-f60eeb5c165d5b9e5998edae7785cc893a613bca.zip
Qt-f60eeb5c165d5b9e5998edae7785cc893a613bca.tar.gz
Qt-f60eeb5c165d5b9e5998edae7785cc893a613bca.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Focus should be applied to focus scopes all the way up the chain, not Add focus docs snippets Fix doc for status, add Image::onLoaded. Don't crash due to recursive positioning. ListModel::get() shouldn't print warnings for invalid indices since it Add \brief to TextInput Add missing .pro Restructure the examples. They are now organized into various graphicsWidgets doc example was previously removed Doc fix Add a "priority" property to Keys and KeyNavigation
Diffstat (limited to 'doc')
-rw-r--r--doc/src/declarative/example-slideswitch.qdoc20
-rw-r--r--doc/src/declarative/examples.qdoc123
-rw-r--r--doc/src/declarative/extending-examples.qdoc50
-rw-r--r--doc/src/declarative/extending.qdoc46
-rw-r--r--doc/src/declarative/focus.qdoc23
-rw-r--r--doc/src/declarative/globalobject.qdoc2
-rw-r--r--doc/src/declarative/integrating.qdoc2
-rw-r--r--doc/src/examples/qml-examples.qdoc184
-rw-r--r--doc/src/snippets/declarative/borderimage.qml (renamed from doc/src/snippets/declarative/border-image.qml)0
-rw-r--r--doc/src/snippets/declarative/focusscopes.qml27
10 files changed, 272 insertions, 205 deletions
diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc
index c14208e..27b7f38 100644
--- a/doc/src/declarative/example-slideswitch.qdoc
+++ b/doc/src/declarative/example-slideswitch.qdoc
@@ -45,7 +45,7 @@
This example shows how to create a reusable switch component in QML.
-The code for this example can be found in the \c $QTDIR/examples/declarative/slideswitch directory.
+The code for this example can be found in the \c $QTDIR/examples/declarative/ui-components/slideswitch directory.
\section1 Overview
@@ -61,12 +61,12 @@ The elements that composed the switch are:
\endlist
\section1 Switch.qml
-\snippet examples/declarative/slideswitch/content/Switch.qml 0
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 0
\section1 Walkthrough
\section2 Interface
-\snippet examples/declarative/slideswitch/content/Switch.qml 1
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 1
This property is the interface of the switch. By default, the switch is off and this property is \c false.
It can be used to activate/disactivate the switch or to query its current state.
@@ -81,14 +81,14 @@ Text { text: "The switch is on"; visible: mySwitch.on == true }
the text will only be visible when the switch is on.
\section2 Images and user interaction
-\snippet examples/declarative/slideswitch/content/Switch.qml 4
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 4
First, we create the background image of the switch.
In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image.
A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a
\c toggle() function. We will see what this function does in a moment.
-\snippet examples/declarative/slideswitch/content/Switch.qml 5
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 5
Then, we place the image of the knob on top of the background.
The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag
@@ -96,7 +96,7 @@ property of the \c MouseArea is for. We also want to toggle the switch if the kn
in the \c dorelease() function that is called in the \c onReleased property.
\section2 States
-\snippet examples/declarative/slideswitch/content/Switch.qml 6
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 6
We define the two states of the switch:
\list
@@ -110,13 +110,13 @@ For more information on states see \l{qmlstates}{QML States}.
We add two JavaScript functions to our switch:
-\snippet examples/declarative/slideswitch/content/Switch.qml 2
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 2
This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two
states (\e on and \e off).
-\snippet examples/declarative/slideswitch/content/Switch.qml 3
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 3
This second function is called when the knob is released and we want to make sure that the knob does not end up between states
(neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing.
@@ -124,7 +124,7 @@ This second function is called when the knob is released and we want to make sur
For more information on scripts see \l{Integrating JavaScript}.
\section2 Transition
-\snippet examples/declarative/slideswitch/content/Switch.qml 7
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 7
At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
In order for the the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
@@ -133,5 +133,5 @@ For more information on transitions see \l{state-transitions}{QML Transitions}.
\section1 Usage
The switch can be used in a QML file, like this:
-\snippet examples/declarative/slideswitch/slideswitch.qml 0
+\snippet examples/declarative/ui-components/slideswitch/slideswitch.qml 0
*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 481617e..cdc308a 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -71,50 +71,92 @@ For example, from your build directory, run:
\section1 Examples
+\section2 Animation
\list
-\o \l{declarative/animations}{Animations}
-\o \l{declarative/aspectratio}{Aspect Ratio}
-\o \l{declarative/behaviors}{Behaviors}
-\o \l{declarative/border-image}{Border Image}
-\o \l{declarative/clocks}{Clocks}
-\o \l{declarative/connections}{Connections}
-\o \l{declarative/dial}{Dial}
-\o \l{declarative/dynamic}{Dynamic}
-\o \l{declarative/extending}{Extending}
-\o \l{declarative/fillmode}{Fillmode}
-\o \l{declarative/flipable}{Flipable}
-\o \l{declarative/focus}{Focus}
-\o \l{declarative/fonts}{Fonts}
-\o \l{declarative/gridview}{GridView}
-\o \l{declarative/imageprovider}{Image Provider}
-\o \l{declarative/images}{Images}
-\o \l{declarative/layouts}{Layouts}
-\o \l{declarative/listmodel-threaded}{ListModel Threaded}
-\o \l{declarative/listview}{ListView}
-\o \l{declarative/mousearea}{Mouse Area}
-\o \l{declarative/objectlistmodel}{Object ListModel}
-\o \l{declarative/package}{Package}
-\o \l{declarative/parallax}{Parallax}
-\o \l{declarative/plugins}{Plugins}
-\o \l{declarative/progressbar}{Progress Bars}
-\o \l{declarative/proxywidgets}{Proxy Widgets}
-\o \l{declarative/scrollbar}{Scrollbar}
-\o \l{declarative/searchbox}{Search Box}
-\o \l{declarative/slideswitch}{Slide Switch}
-\o \l{declarative/sql}{SQL}
-\o \l{declarative/states}{States}
-\o \l{declarative/stringlistmodel}{String ListModel}
-\o \l{declarative/tabwidget}{Tab Widget}
-\o \l{declarative/tic-tac-toe}{Tic-Tac-Toe}
-\o \l{declarative/tvtennis}{TV Tennis}
-\o \l{declarative/velocity}{Velocity}
-\o \l{declarative/webview}{WebView}
-\o \l{declarative/workerscript}{WorkerScript}
-\o \l{declarative/xmldata}{XML Data}
-\o \l{declarative/xmlhttprequest}{XMLHttpRequest}
+\o \l{declarative/animation/basics}{Basics}
+\o \l{declarative/animation/behaviors}{Behaviors}
+\o \l{declarative/animation/easing}{Easing}
+\o \l{declarative/animation/states}{States}
+\endlist
+
+\section2 Image Elements
+\list
+\o \l{declarative/imageelements/borderimage}{BorderImage}
+\o \l{declarative/imageelements/image}{Image}
+\endlist
+
+\section2 \l{declarative/positioners}{Positioners}
+
+\section2 Key Interaction
+\list
+\o \l{declarative/keyinteraction/focus}{Focus}
+\endlist
+\section2 Touch Interaction
+\list
+\o \l{declarative/touchinteraction/gestures}{Gestures}
+\o \l{declarative/touchinteraction/mousearea}{MouseArea}
+\endlist
+
+\section2 UI Components
+\list
+\o \l{declarative/ui-components/flipable}{Flipable}
+\o \l{declarative/ui-components/progressbar}{Progress bar}
+\o \l{declarative/ui-components/scrollbar}{Scroll bar}
+\o \l{declarative/ui-components/searchbox}{Search box}
+\o \l{declarative/ui-components/slideswitch}{Slide switch}
+\o \l{declarative/ui-components/spinner}{Spinner}
+\o \l{declarative/ui-components/tabwidget}{Tab widget}
\endlist
+\section2 Models and Views
+\list
+\o \l{declarative/modelviews/gridview}{GridView}
+\o \l{declarative/modelviews/listview}{ListView}
+\o \l{declarative/modelviews/objectlistmodel}{Object list model}
+\o \l{declarative/modelviews/package}{Package}
+\o \l{declarative/modelviews/parallax}{Parallax}
+\o \l{declarative/modelviews/stringlistmodel}{String list model}
+\o \l{declarative/modelviews/webview}{WebView}
+\endlist
+
+\section2 XML
+\list
+\o \l{declarative/xml/xmldata}{XML data}
+\o \l{declarative/xml/xmlhttprequest}{XmlHttpRequest}
+\endlist
+
+\section2 \l{declarative/i18n}{Internationalization (i18n)}
+
+\section2 Threading
+\list
+\o \l{declarative/threading/threadedlistmodel}{Threaded ListModel}
+\o \l{declarative/threading/workerscript}{WorkerScript}
+\endlist
+
+\section2 \l{declarative/sqllocalstorage}{SQL Local Storage}
+
+\section2 C++ Extensions
+\list
+\o \l{declarative/cppextensions/referenceexamples}{Reference examples} (discussed in \l {Extending QML in C++})
+\o \l{declarative/cppextensions/plugins}{Plugins}
+\o \l{declarative/cppextensions/proxywidgets}{QtWidgets}
+\o \l{declarative/cppextensions/qgraphicslayouts}{QGraphicsLayouts}
+\o \l{declarative/cppextensions/imageprovider}{Image provider}
+\o \l{declarative/cppextensions/proxyviewer}{Network access manager factory}
+\endlist
+
+\section2 Toys
+\list
+\o \l{declarative/toys/clocks}{Clocks}
+\o \l{declarative/toys/dial}{Dial}
+\o \l{declarative/toys/dynamic}{Dynamic}
+\o \l{declarative/toys/tic-tac-toe}{Tic Tac Toe}
+\o \l{declarative/toys/tvtennis}{TV Tennis}
+\o \l{declarative/toys/velocity}{Velocity}
+\endlist
+
+
\section1 Demos
\list
@@ -127,3 +169,4 @@ For example, from your build directory, run:
\endlist
*/
+
diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc
index 611dac1..577ab78 100644
--- a/doc/src/declarative/extending-examples.qdoc
+++ b/doc/src/declarative/extending-examples.qdoc
@@ -40,13 +40,13 @@
****************************************************************************/
/*!
-\example declarative/extending/adding
+\example declarative/cppextensions/referenceexamples/adding
\title Extending QML - Adding Types Example
The Adding Types Example shows how to add a new element type, \c Person, to QML.
The \c Person type can be used from QML like this:
-\snippet examples/declarative/extending/adding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
\section1 Declare the Person class
@@ -55,11 +55,11 @@ with the two properties we want accessible on the QML type - name and shoeSize.
Although in this example we use the same name for the C++ class as the QML
element, the C++ class can be named differently, or appear in a namespace.
-\snippet examples/declarative/extending/adding/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.h 0
\section1 Define the Person class
-\snippet examples/declarative/extending/adding/person.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.cpp 0
The Person class implementation is quite basic. The property accessors simply
return members of the object instance.
@@ -75,7 +75,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/properties
+\example declarative/cppextensions/referenceexamples/properties
\title Extending QML - Object and List Property Types Example
This example builds on:
@@ -88,16 +88,16 @@ properties in QML. This example adds a BirthdayParty element that specifies
a birthday party, consisting of a celebrant and a list of guests. People are
specified using the People QML type built in the previous example.
-\snippet examples/declarative/extending/properties/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
\section1 Declare the BirthdayParty
The BirthdayParty class is declared like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 0
-\snippet examples/declarative/extending/properties/birthdayparty.h 1
-\snippet examples/declarative/extending/properties/birthdayparty.h 2
-\snippet examples/declarative/extending/properties/birthdayparty.h 3
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 3
The class contains a member to store the celebrant object, and also a
QList<Person *> member.
@@ -114,7 +114,7 @@ scenarios.
The implementation of BirthdayParty property accessors is straight forward.
-\snippet examples/declarative/extending/properties/birthdayparty.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp 0
\section1 Running the example
@@ -123,7 +123,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/coercion
+\example declarative/cppextensions/referenceexamples/coercion
\title Extending QML - Inheritance and Coercion Example
This example builds on:
@@ -136,11 +136,11 @@ The Inheritance and Coercion Example shows how to use base classes to assign
elements of more than one type to a property. It specializes the Person element
developed in the previous examples into two elements - a \c Boy and a \c Girl.
-\snippet examples/declarative/extending/coercion/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
\section1 Declare Boy and Girl
-\snippet examples/declarative/extending/coercion/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.h 0
The Person class remains unaltered in this example and the Boy and Girl C++
classes are trivial extensions of it. As an example, the inheritance used here
@@ -155,7 +155,7 @@ previous example. However, as we have repurposed the People class as a common
base for Boy and Girl, we want to prevent it from being instantiated from QML
directly - an explicit Boy or Girl should be instantiated instead.
-\snippet examples/declarative/extending/coercion/main.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp 0
While we want to disallow instantiating Person from within QML, it still needs
to be registered with the QML engine, so that it can be used as a property type
@@ -165,7 +165,7 @@ and other types can be coerced to it.
The implementation of Boy and Girl are trivial.
-\snippet examples/declarative/extending/coercion/person.cpp 1
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.cpp 1
All that is necessary is to implement the constructor, and to register the types
and their QML name with the QML engine.
@@ -175,7 +175,7 @@ and their QML name with the QML engine.
The BirthdayParty element has not changed since the previous example. The
celebrant and guests property still use the People type.
-\snippet examples/declarative/extending/coercion/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h 0
However, as all three types, Person, Boy and Girl, have been registered with the
QML system, on assignment QML automatically (and type-safely) converts the Boy
@@ -186,7 +186,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/default
+\example declarative/cppextensions/referenceexamples/default
\title Extending QML - Default Property Example
This example builds on:
@@ -200,14 +200,14 @@ The Default Property Example is a minor modification of the
\l {Extending QML - Inheritance and Coercion Example} that simplifies the
specification of a BirthdayParty through the use of a default property.
-\snippet examples/declarative/extending/default/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
\section1 Declaring the BirthdayParty class
The only difference between this example and the last, is the addition of the
\c DefaultProperty class info annotation.
-\snippet examples/declarative/extending/default/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h 0
The default property specifies the property to assign to whenever an explicit
property is not specified, in the case of the BirthdayParty element the guest
@@ -222,7 +222,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/grouped
+\example declarative/cppextensions/referenceexamples/grouped
\title Extending QML - Grouped Properties Example
This example builds on:
@@ -236,7 +236,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/grouped
+\example declarative/cppextensions/referenceexamples/grouped
\title Extending QML - Attached Properties Example
This example builds on:
@@ -251,7 +251,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/signal
+\example declarative/cppextensions/referenceexamples/signal
\title Extending QML - Signal Support Example
This example builds on:
@@ -267,7 +267,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/valuesource
+\example declarative/cppextensions/referenceexamples/valuesource
\title Extending QML - Property Value Source Example
This example builds on:
@@ -284,7 +284,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/binding
+\example declarative/cppextensions/referenceexamples/binding
\title Extending QML - Binding Example
This example builds on:
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 1c159e4..5b695f7 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -56,7 +56,7 @@ QML for their own independent use.
\section1 Adding Types
\target adding-types
-\snippet examples/declarative/extending/adding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
The QML snippet shown above instantiates one \c Person instance and sets
the \c name and \c shoeSize properties on it. Everything in QML ultimately comes down
@@ -121,7 +121,7 @@ the \c Person type.
\section1 Object and List Property Types
-\snippet examples/declarative/extending/properties/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's
\c host property, and assigns three \c Person objects to the guests property.
@@ -136,7 +136,7 @@ Properties that are pointers to objects or Qt interfaces are declared with the
Q_PROPERTY() macro, just like other properties. The \c host property
declaration looks like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
As long as the property type, in this case \c Person, is registered with QML the
property can be assigned.
@@ -165,14 +165,14 @@ As with object properties, the type \a T must be registered with QML.
The \c guest property declaration looks like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
\l {Extending QML - Object and List Property Types Example} shows the complete
code used to create the \c BirthdayParty type.
\section1 Inheritance and Coercion
-\snippet examples/declarative/extending/coercion/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's
\c host property, and assigns three other objects to the \c guests property.
@@ -214,7 +214,7 @@ code used to create the \c Boy and \c Girl types.
\section1 Default Property
-\snippet examples/declarative/extending/default/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
The QML snippet shown above assigns a collection of objects to the
\c BirthdayParty's default property.
@@ -246,7 +246,7 @@ specify a default property.
\section1 Grouped Properties
-\snippet examples/declarative/extending/grouped/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml 1
The QML snippet shown above assigns a number of properties to the \c Boy object,
including four properties using the grouped property syntax.
@@ -259,7 +259,7 @@ different types through implementation reuse.
A grouped property block is implemented as a read-only object property. The
\c shoe property shown is declared like this:
-\snippet examples/declarative/extending/grouped/person.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/person.h 1
The \c ShoeDescription type declares the properties available to the grouped
property block - in this case the \c size, \c color, \c brand and \c price properties.
@@ -271,7 +271,7 @@ implement the \c shoe property grouping.
\section1 Attached Properties
-\snippet examples/declarative/extending/attached/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml 1
The QML snippet shown above assigns a date to the \c rsvp property using the attached
property syntax.
@@ -393,8 +393,8 @@ this situation, but it must not crash.
\section1 Signal Support
-\snippet examples/declarative/extending/signal/example.qml 0
-\snippet examples/declarative/extending/signal/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 1
The QML snippet shown above associates the evaluation of a JavaScript expression
with the emission of a Qt signal.
@@ -406,7 +406,7 @@ signal name: "on" is prepended, and the first letter of the signal name upper
cased. For example, the signal used in the example above has the following
C++ signature:
-\snippet examples/declarative/extending/signal/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h 0
In classes with multiple signals with the same name, only the final signal
is accessible as a signal property. Note that signals with the same name
@@ -424,8 +424,8 @@ implement the onPartyStarted signal property.
\section1 Property Value Sources
-\snippet examples/declarative/extending/valuesource/example.qml 0
-\snippet examples/declarative/extending/valuesource/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1
The QML snippet shown above applies a property value source to the \c announcment property.
A property value source generates a value for a property that changes over time.
@@ -440,7 +440,7 @@ The example shown here is rather contrived: the \c announcment property of the
the \c HappyBirthdaySong value source generates the lyrics of the song
"Happy Birthday".
-\snippet examples/declarative/extending/valuesource/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h 0
Normally, assigning an object to a string property would not be allowed. In
the case of a property value source, rather than assigning the object instance
@@ -453,9 +453,9 @@ QDeclarativePropertyValueSource::setTarget(), that the QML engine invokes when
associating the property value source with a property. The relevant part of
the \c HappyBirthdaySong type declaration looks like this:
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 0
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 1
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2
In all other respects, property value sources are regular QML types. They must
be registered with the QML engine using the same macros as other types, and can
@@ -471,8 +471,8 @@ implement the \c HappyBirthdaySong property value source.
\section1 Property Binding
-\snippet examples/declarative/extending/binding/example.qml 0
-\snippet examples/declarative/extending/binding/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 1
The QML snippet shown above uses a property binding to ensure the
\c HappyBirthdaySong's \c name property remains up to date with the \c host.
@@ -492,7 +492,7 @@ the property's value. QML relies on the presence of a
Here is the \c host property declaration:
-\snippet examples/declarative/extending/binding/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h 0
The NOTIFY attribute is followed by a signal name. It is the responsibility of
the class implementer to ensure that whenever the property's value changes, the
@@ -531,7 +531,7 @@ subsequently change. The most common case of this is when a type uses
only freed when the object is deleted. In these cases, the CONSTANT attribute
may be added to the property declaration instead of a NOTIFY signal.
-\snippet examples/declarative/extending/binding/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/person.h 0
Extreme care must be taken here or applications using your type may misbehave.
The CONSTANT attribute should only be used for properties whose value is set,
@@ -543,7 +543,7 @@ include NOTIFY signals for use in binding.
\section1 Extension Objects
-\snippet examples/declarative/extending/extended/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/extended/example.qml 0
The QML snippet shown above adds a new property to an existing C++ type without
modifying its source code.
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index e5c1d32..e2b8bb6 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -291,28 +291,7 @@ print the name of the current list item.
\table
\row
-\o \code
-Rectangle {
- color: "lightsteelblue"; width: 240; height: 320
-
- ListView {
- id: myView; anchors.fill: parent; focus: true
- model: ListModel {
- ListElement { name: "Bob" }
- ListElement { name: "John" }
- ListElement { name: "Michael" }
- }
- delegate: FocusScope {
- width: contents.width; height: contents.height
- Text {
- focus: true
- text: name
- Keys.onReturnPressed: console.log(name)
- }
- }
- }
-}
-\endcode
+\o \snippet doc/src/snippets/declarative/focusscopes.qml 0
\o \image declarative-qmlfocus4.png
\endtable
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index bc9830a..2a83e30 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -382,7 +382,7 @@ of QDeclarativeEngine::offlineStoragePath(), currently as SQLite databases.
The API can be used from JavaScript functions in your QML:
-\quotefile declarative/sql/hello.qml
+\quotefile declarative/sqllocalstorage/hello.qml
The API conforms to the Synchronous API of the HTML5 Web Database API,
\link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink.
diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc
index 972976f..83380a1 100644
--- a/doc/src/declarative/integrating.qdoc
+++ b/doc/src/declarative/integrating.qdoc
@@ -110,7 +110,7 @@ of QML UIs:
\section2 Loading QGraphicsWidget objects in QML
An alternative approach is to expose your existing QGraphicsWidget objects to
-QML and construct your scene in QML instead. See the \l {declarative/layouts/graphicsLayouts}{graphics layouts example}
+QML and construct your scene in QML instead. See the \l {declarative/cppextensions/qgraphicslayouts}{graphics layouts example}
which shows how to expose Qt's graphics layout classes to QML in order
to use QGraphicsWidget with classes like QGraphicsLinearLayout and QGraphicsGridLayout.
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index 93e4a46..22113ee 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -40,79 +40,89 @@
****************************************************************************/
/*!
- \title Animations
- \example declarative/animations
+ \title Animation basics
+ \example declarative/animation/basics
This example shows how to use animations in QML.
*/
/*!
- \title AspectRatio
- \example declarative/aspectratio
+ \title Behaviors
+ \example declarative/animation/behaviors
+*/
- This example shows how to implement different aspect ratios in QML.
+/*!
+ \title Easing types
+ \example declarative/animation/easing
+
+ This example shows the different easing modes available for animations.
*/
/*!
- \example declarative/behaviors
- \title Behaviors
+ \title States
+ \example declarative/animation/states
*/
/*!
\title Border Image
- \example declarative/border-image
+ \example declarative/imageelements/borderimage
This example shows how to use a BorderImage in QML.
*/
/*!
- \title Clocks
- \example declarative/clocks
+ \title Image
+ \example declarative/imageelements/image
- This example shows how to create a Clock component and reuse it in a grid.
+ This example shows uses of the \l Image element in QML.
*/
/*!
- \title Connections
- \example declarative/connections
-
- This example shows how to use a Connection element in QML.
+ \title Reference examples
+ \example declarative/cppextensions/referenceexamples
*/
/*!
- \title Dial
- \example declarative/dial
+ \title Plugins
+ \example declarative/cppextensions/plugins
+*/
- This example shows how to implement a dial in QML.
+/*!
+ \title QtWidgets
+ \example declarative/cppextensions/proxywidgets
*/
/*!
- \title Dynamic
- \example declarative/dynamic
+ \title QGraphicsLayouts
+ \example declarative/cppextensions/qgraphicslayouts
+*/
- This example shows how to create dynamic objects QML.
+/*!
+ \title Image Provider
+ \example declarative/cppextensions/imageprovider
*/
/*!
- \example declarative/extending
- \title Extending
+ \title Network access manager
+ \example declarative/cppextensions/proxyviewer
*/
/*!
- \example declarative/fillmode
- \title Fillmode
+ \title Internationlization
+ \example declarative/i18n
*/
/*!
- \title Flipable
- \example declarative/flipable
+ \title Positioners
+ \example declarative/positioners
- This example shows how to use a Flipable element in QML.
+ This example shows how to use positioner elements such as Row, Column,
+ Grid and Flow.
*/
/*!
\title Focus
- \example declarative/focus
+ \example declarative/keyinteraction/focus
This example shows how to handle keys and focus in QML.
@@ -120,141 +130,149 @@
*/
/*!
- \example declarative/fonts
- \title Fonts
+ \title GridView
+ \example declarative/modelviews/gridview
*/
/*!
- \example declarative/gridview
- \title GridView
+ \title ListView
+ \example declarative/modelviews/listview
*/
/*!
- \example declarative/imageprovider
- \title Image Provider
+ \title Object ListModel
+ \example declarative/modelviews/objectlistmodel
*/
/*!
- \example declarative/images
- \title Images
+ \title Package
+ \example declarative/modelviews/package
*/
/*!
- \example declarative/layouts
- \title Layouts
+ \title Parallax
+ \example declarative/modelviews/parallax
*/
/*!
- \example declarative/listmodel-threaded
- \title ListModel Threaded
+ \title String ListModel
+ \example declarative/modelviews/stringlistmodel
*/
/*!
- \example declarative/listview
- \title ListView
+ \title WebView
+ \example declarative/modelviews/webview
*/
/*!
- \example declarative/mousearea
- \title Mouse Area
+ \title SQL Local Storage
+ \example declarative/sqllocalstorage
*/
/*!
- \example declarative/objectlistmodel
- \title Object ListModel
+ \title Fonts
+ \example declarative/text/fonts
*/
/*!
- \example declarative/package
- \title Package
+ \title Threaded ListModel
+ \example declarative/threading/threadedlistmodel
*/
/*!
- \example declarative/parallax
- \title Parallax
+ \title WorkerScript
+ \example declarative/threading/workerscript
*/
/*!
- \example declarative/plugins
- \title Plugins
+ \title Clocks
+ \example declarative/toys/clocks
+
+ This example shows how to create a Clock component and reuse it in a grid.
*/
/*!
- \example declarative/progressbar
- \title Progress Bars
+ \title Dial
+ \example declarative/toys/dial
+
+ This example shows how to implement a dial in QML.
*/
/*!
- \example declarative/proxywidgets
- \title Proxy Widgets
+ \title Dynamic
+ \example declarative/toys/dynamic
+
+ This example shows how to create dynamic objects QML.
*/
/*!
- \example declarative/scrollbar
- \title Scrollbar
+ \title Tic-Tac-Toe
+ \example declarative/toys/tic-tac-toe
*/
/*!
- \example declarative/searchbox
- \title Search Box
+ \title TV Tennis
+ \example declarative/toys/tvtennis
*/
/*!
- \example declarative/slideswitch
- \title Slide Switch
+ \title Velocity
+ \example declarative/toys/velocity
*/
/*!
- \example declarative/sql
- \title SQL
+ \title Gestures
+ \example declarative/touchinteraction/gestures
*/
/*!
- \example declarative/states
- \title States
+ \title Mouse Area
+ \example declarative/touchinteraction/mousearea
*/
/*!
- \example declarative/stringlistmodel
- \title String ListModel
+ \title Flipable
+ \example declarative/ui-components/flipable
+
+ This example shows how to use a Flipable element in QML.
*/
/*!
- \example declarative/tabwidget
- \title Tab Widget
+ \title Progress Bars
+ \example declarative/ui-components/progressbar
*/
/*!
- \example declarative/tic-tac-toe
- \title Tic-Tac-Toe
+ \title Scrollbar
+ \example declarative/ui-components/scrollbar
*/
/*!
- \example declarative/tvtennis
- \title TV Tennis
+ \title Search Box
+ \example declarative/ui-components/searchbox
*/
/*!
- \example declarative/velocity
- \title Velocity
+ \title Slide Switch
+ \example declarative/ui-components/slideswitch
*/
/*!
- \example declarative/webview
- \title WebView
+ \title Spinner
+ \example declarative/ui-components/spinner
*/
/*!
- \example declarative/workerscript
- \title WorkerScript
+ \title Tab Widget
+ \example declarative/ui-components/tabwidget
*/
/*!
- \example declarative/xmldata
\title XML Data
+ \example declarative/xml/xmldata
*/
/*!
- \example declarative/xmlhttprequest
\title XMLHttpRequest
+ \example declarative/xml/xmlhttprequest
*/
diff --git a/doc/src/snippets/declarative/border-image.qml b/doc/src/snippets/declarative/borderimage.qml
index 9c4247e..9c4247e 100644
--- a/doc/src/snippets/declarative/border-image.qml
+++ b/doc/src/snippets/declarative/borderimage.qml
diff --git a/doc/src/snippets/declarative/focusscopes.qml b/doc/src/snippets/declarative/focusscopes.qml
new file mode 100644
index 0000000..686de29
--- /dev/null
+++ b/doc/src/snippets/declarative/focusscopes.qml
@@ -0,0 +1,27 @@
+import Qt 4.7
+
+//![0]
+Rectangle {
+ color: "lightsteelblue"; width: 240; height: 320
+
+ ListView {
+ anchors.fill: parent
+ focus: true
+
+ model: ListModel {
+ ListElement { name: "Bob" }
+ ListElement { name: "John" }
+ ListElement { name: "Michael" }
+ }
+
+ delegate: FocusScope {
+ width: childrenRect.width; height: childrenRect.height
+ TextInput {
+ focus: true
+ text: name
+ Keys.onReturnPressed: console.log(name)
+ }
+ }
+ }
+ }
+//![0]