summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-08-04 16:50:23 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-08-04 16:50:23 (GMT)
commite8b116e793d13204fb00b286becf95d2a933a784 (patch)
tree7d94b673694d5c9e7475faeae35f1268e518cca8 /doc
parent42f1e22bdfe2fe29f305dbf50e23933b8e1ef8d0 (diff)
parenta214bb99775e898fd9233b932f08ff91a57fc053 (diff)
downloadQt-e8b116e793d13204fb00b286becf95d2a933a784.zip
Qt-e8b116e793d13204fb00b286becf95d2a933a784.tar.gz
Qt-e8b116e793d13204fb00b286becf95d2a933a784.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Conflicts: doc/src/examples/qml-examples.qdoc
Diffstat (limited to 'doc')
-rw-r--r--doc/src/declarative/animation.qdoc4
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc119
-rw-r--r--doc/src/declarative/examples.qdoc6
-rw-r--r--doc/src/declarative/extending-tutorial.qdoc32
-rw-r--r--doc/src/declarative/focus.qdoc10
-rw-r--r--doc/src/declarative/javascriptblocks.qdoc25
-rw-r--r--doc/src/declarative/modules.qdoc293
-rw-r--r--doc/src/declarative/pics/anatomy-component.pngbin16117 -> 4902 bytes
-rw-r--r--doc/src/declarative/qdeclarativedocument.qdoc62
-rw-r--r--doc/src/declarative/qdeclarativei18n.qdoc2
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc9
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc16
-rw-r--r--doc/src/declarative/qdeclarativestates.qdoc183
-rw-r--r--doc/src/declarative/qmlviewer.qdoc8
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc16
-rw-r--r--doc/src/declarative/tutorial.qdoc2
-rw-r--r--doc/src/development/debug.qdoc2
-rw-r--r--doc/src/development/developing-with-qt.qdoc61
-rw-r--r--doc/src/development/qmake-manual.qdoc7
-rw-r--r--doc/src/examples/fingerpaint.qdoc6
-rw-r--r--doc/src/examples/pinchzoom.qdoc6
-rw-r--r--doc/src/examples/qml-examples.qdoc110
-rw-r--r--doc/src/examples/touch-dials.qdoc (renamed from doc/src/examples/multitouch-dials.qdoc)8
-rw-r--r--doc/src/examples/touch-knobs.qdoc (renamed from doc/src/examples/multitouch-knobs.qdoc)10
-rw-r--r--doc/src/files-and-resources/resources.qdoc2
-rw-r--r--doc/src/frameworks-technologies/eventsandfilters.qdoc2
-rw-r--r--doc/src/getting-started/examples.qdoc16
-rw-r--r--doc/src/getting-started/gettingstarted.qdoc516
-rw-r--r--doc/src/getting-started/installation.qdoc7
-rw-r--r--doc/src/getting-started/tutorials.qdoc24
-rw-r--r--doc/src/images/addressbook-tutorial-part1-labeled-layout.pngbin20739 -> 19114 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part1-labeled-screenshot.pngbin26594 -> 23223 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part1-screenshot.pngbin7180 -> 9872 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part2-add-contact.pngbin10255 -> 12936 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part2-add-successful.pngbin8089 -> 10825 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part2-labeled-layout.pngbin31947 -> 27103 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part3-labeled-layout.pngbin39500 -> 27467 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part3-screenshot.pngbin10460 -> 14041 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part4-remove.pngbin13860 -> 22248 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part5-finddialog.pngbin6982 -> 10046 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part5-notfound.pngbin8177 -> 10789 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part5-screenshot.pngbin12557 -> 15849 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part6-load.pngbin40623 -> 24797 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part6-save.pngbin40406 -> 24747 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part6-screenshot.pngbin13598 -> 16819 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-part7-screenshot.pngbin14822 -> 18369 bytes
-rw-r--r--doc/src/images/addressbook-tutorial-screenshot.pngbin11916 -> 15275 bytes
-rw-r--r--doc/src/images/addressbook-tutorial.pngbin11481 -> 6200 bytes
-rwxr-xr-xdoc/src/images/clock.pngbin0 -> 16514 bytes
-rw-r--r--doc/src/images/columnview.pngbin0 -> 3480 bytes
-rwxr-xr-xdoc/src/images/combobox.pngbin0 -> 5022 bytes
-rwxr-xr-xdoc/src/images/dummy_tree.pngbin0 -> 20189 bytes
-rwxr-xr-xdoc/src/images/edit.pngbin0 -> 19636 bytes
-rwxr-xr-xdoc/src/images/example_model.pngbin0 -> 16577 bytes
-rw-r--r--doc/src/images/gs1.pngbin0 -> 7860 bytes
-rw-r--r--doc/src/images/gs2.pngbin0 -> 8630 bytes
-rw-r--r--doc/src/images/gs3.pngbin0 -> 9781 bytes
-rw-r--r--doc/src/images/gs4.pngbin0 -> 7494 bytes
-rw-r--r--doc/src/images/gs5.pngbin0 -> 23537 bytes
-rwxr-xr-xdoc/src/images/header.pngbin0 -> 30302 bytes
-rwxr-xr-xdoc/src/images/lineedit.pngbin0 -> 2613 bytes
-rwxr-xr-xdoc/src/images/list_table_tree.pngbin0 -> 85530 bytes
-rwxr-xr-xdoc/src/images/listview.pngbin0 -> 9695 bytes
-rwxr-xr-xdoc/src/images/lotto.pngbin0 -> 17015 bytes
-rwxr-xr-xdoc/src/images/modelview.pngbin0 -> 2887 bytes
-rwxr-xr-xdoc/src/images/path.pngbin0 -> 31015 bytes
-rwxr-xr-xdoc/src/images/qcompleter.pngbin0 -> 17017 bytes
-rw-r--r--doc/src/images/qml-pathview-example.pngbin0 -> 22077 bytes
-rwxr-xr-xdoc/src/images/readonlytable.pngbin0 -> 28971 bytes
-rwxr-xr-xdoc/src/images/readonlytable_role.pngbin0 -> 27467 bytes
-rwxr-xr-xdoc/src/images/selection2.pngbin0 -> 23784 bytes
-rwxr-xr-xdoc/src/images/standardwidget.pngbin0 -> 1466 bytes
-rwxr-xr-xdoc/src/images/tableview.pngbin0 -> 10102 bytes
-rw-r--r--doc/src/images/touch-dials-example.png (renamed from doc/src/images/multitouch-dials-example.png)bin17676 -> 17676 bytes
-rw-r--r--doc/src/images/touch-examples.png (renamed from doc/src/images/multitouch-examples.png)bin6691 -> 6691 bytes
-rw-r--r--doc/src/images/touch-fingerpaint-example.png (renamed from doc/src/images/multitouch-fingerpaint-example.png)bin17026 -> 17026 bytes
-rw-r--r--doc/src/images/touch-knobs-example.png (renamed from doc/src/images/multitouch-knobs-example.png)bin1290 -> 1290 bytes
-rw-r--r--doc/src/images/touch-pinchzoom-example.png (renamed from doc/src/images/multitouch-pinchzoom-example.png)bin48154 -> 48154 bytes
-rwxr-xr-xdoc/src/images/tree.pngbin0 -> 27074 bytes
-rwxr-xr-xdoc/src/images/tree_2.pngbin0 -> 14084 bytes
-rwxr-xr-xdoc/src/images/tree_2_with_algorithm.pngbin0 -> 16921 bytes
-rwxr-xr-xdoc/src/images/tree_city.pngbin0 -> 30398 bytes
-rwxr-xr-xdoc/src/images/treeview.pngbin0 -> 17173 bytes
-rwxr-xr-xdoc/src/images/treeview_sml.pngbin0 -> 17419 bytes
-rwxr-xr-xdoc/src/images/widgetmapper.pngbin0 -> 20145 bytes
-rw-r--r--doc/src/index.qdoc41
-rw-r--r--doc/src/internationalization/linguist-manual.qdoc4
-rw-r--r--doc/src/legal/3rdparty.qdoc234
-rw-r--r--doc/src/legal/licenses.qdoc49
-rw-r--r--doc/src/network-programming/bearermanagement.qdoc2
-rw-r--r--doc/src/platforms/mac-differences.qdoc3
-rw-r--r--doc/src/porting/porting4.qdoc14
-rw-r--r--doc/src/qt-webpages.qdoc8
-rw-r--r--doc/src/qt4-intro.qdoc8
-rw-r--r--doc/src/snippets/code/doc_src_containers.qdoc8
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc4
-rw-r--r--doc/src/snippets/code/doc_src_qalgorithms.qdoc2
-rw-r--r--doc/src/snippets/code/doc_src_qset.qdoc2
-rw-r--r--doc/src/snippets/code/doc_src_qt4-tulip.qdoc2
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp2
-rw-r--r--doc/src/snippets/code/src_gui_kernel_qapplication.cpp4
-rw-r--r--doc/src/snippets/code/src_network_kernel_qhostinfo.cpp2
-rw-r--r--doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp2
-rw-r--r--doc/src/snippets/declarative/anchoranimation.qml65
-rw-r--r--doc/src/snippets/declarative/behavior.qml59
-rw-r--r--doc/src/snippets/declarative/coloranimation.qml52
-rw-r--r--doc/src/snippets/declarative/comments.qml3
-rw-r--r--doc/src/snippets/declarative/component.qml60
-rw-r--r--doc/src/snippets/declarative/componentCreation.js63
-rw-r--r--doc/src/snippets/declarative/createComponent-simple.qml57
-rw-r--r--doc/src/snippets/declarative/createComponent.qml4
-rw-r--r--doc/src/snippets/declarative/createQmlObject.qml7
-rw-r--r--doc/src/snippets/declarative/dynamicObjects-destroy.qml55
-rw-r--r--doc/src/snippets/declarative/mouseareadragfilter.qml72
-rw-r--r--doc/src/snippets/declarative/numberanimation.qml52
-rw-r--r--doc/src/snippets/declarative/parallelanimation.qml57
-rw-r--r--doc/src/snippets/declarative/parentanimation.qml74
-rw-r--r--doc/src/snippets/declarative/parentchange.qml5
-rw-r--r--doc/src/snippets/declarative/pathview/pathattributes.qml12
-rw-r--r--doc/src/snippets/declarative/propertyanimation.qml101
-rw-r--r--doc/src/snippets/declarative/qmldocuments.qml66
-rw-r--r--doc/src/snippets/declarative/qtobject.qml55
-rw-r--r--doc/src/snippets/declarative/rotationanimation.qml66
-rw-r--r--doc/src/snippets/declarative/sequentialanimation.qml57
-rw-r--r--doc/src/snippets/declarative/smoothedanimation.qml69
-rw-r--r--doc/src/snippets/declarative/springanimation.qml (renamed from doc/src/snippets/declarative/dynamicObjects.qml)36
-rw-r--r--doc/src/snippets/declarative/state-when.qml55
-rw-r--r--doc/src/snippets/declarative/state.qml21
-rw-r--r--doc/src/snippets/declarative/states.qml38
-rw-r--r--doc/src/snippets/declarative/transition-from-to.qml62
-rw-r--r--doc/src/snippets/declarative/transition-reversible.qml65
-rw-r--r--doc/src/snippets/declarative/transition.qml59
-rw-r--r--doc/src/snippets/droparea.cpp2
-rw-r--r--doc/src/snippets/picture/picture.cpp4
-rw-r--r--doc/src/snippets/qfontdatabase/main.cpp4
-rw-r--r--doc/src/snippets/qlistview-dnd/model.cpp4
-rw-r--r--doc/src/snippets/qstringlist/main.cpp2
-rw-r--r--doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp2
-rw-r--r--doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp4
-rw-r--r--doc/src/template/style/OfflineStyle.css251
-rw-r--r--doc/src/template/style/narrow.css21
-rwxr-xr-xdoc/src/template/style/style.css13
-rw-r--r--doc/src/template/style/superfish_skin.css83
-rwxr-xr-xdoc/src/tutorials/modelview.qdoc938
-rw-r--r--doc/src/widgets-and-layouts/layout.qdoc2
145 files changed, 3921 insertions, 811 deletions
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
index c5333df..401cf16 100644
--- a/doc/src/declarative/animation.qdoc
+++ b/doc/src/declarative/animation.qdoc
@@ -67,7 +67,9 @@ A property animation can also be specified as a resource that is manipulated fro
\snippet doc/src/snippets/declarative/animation.qml property-anim-3
As can be seen, when an animation is used like this (as opposed to as a value source) you will need
-to explicitly set the \c target and \c property to animate.
+to explicitly set the \c target and \c property to animate. This also the only case where
+an animation needs to be started explictly by either setting the \c running property to
+true or calling the \c start() method.
Animations can be joined into a group using SequentialAnimation and ParallelAnimation.
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index a5e53a9..997f601 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -39,31 +39,35 @@ QML also supports the dynamic creation of objects from within JavaScript
code. This is useful if the existing QML elements do not fit the needs of your
application, and there are no C++ components involved.
-See the {declarative/toys/dynamicscene}{Dynamic Scene example} for a demonstration
+See the \l {declarative/toys/dynamicscene}{Dynamic Scene example} for a demonstration
of the concepts discussed on this page.
\section1 Creating Objects Dynamically
There are two ways to create objects dynamically from JavaScript. You can either call
-\l {QML:Qt::createComponent()}{Qt.createComponent()} to create
-a component which instantiates items, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+\l {QML:Qt::createComponent()}{Qt.createComponent()} to dynamically create
+a \l Component object, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
to create an item from a string of QML.
-Creating a component is better if you have a predefined
-item, and you want to create dynamic instances of that item; creating an item from
-a string of QML is useful when the item QML itself is generated at runtime.
+Creating a component is better if you have an existing component defined in a \c .qml
+file, and you want to dynamically create instances of that component. Otherwise,
+creating an item from a string of QML is useful when the item QML itself is generated
+at runtime.
-If you have a component specified in a QML file, you can dynamically load it with
-the \l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
-This function takes the URL of the QML file as its only argument and returns
-a component object which can be used to create and load that QML file.
-Once you have a component you can use its \l {Component::createObject()}{createObject()} method to create an instance of
+\section2 Creating a Component dynamically
+
+To dynamically load a component defined in a QML file, call the
+\l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
+This function takes the URL of the QML file as its only argument and creates
+a \l Component object from this URL.
+
+Once you have a \l Component, you can call its \l {Component::createObject()}{createObject()} method to create an instance of
the component. This function takes exactly one argument, which is the parent for the new item. Since graphical items will
not appear on the scene without a parent, it is recommended that you set the parent this way. However, if you wish to set
-the parent later you can safely pass null to this function.
+the parent later you can safely pass \c null to this function.
-Here is an example. Here is a \c Sprite.qml, which defines a simple QML component:
+Here is an example. First there is \c Sprite.qml, which defines a simple QML component:
\snippet doc/src/snippets/declarative/Sprite.qml 0
@@ -72,35 +76,48 @@ that will create \c Sprite objects:
\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:
+Here is \c componentCreation.js. Notice it checks whether the component \l{Component::status}{status} is
+\c Component.Ready before calling \l {Component::createObject()}{createObject()}
+in case the QML file is loaded over a network and thus is not ready immediately.
-\snippet doc/src/snippets/declarative/componentCreation.js 0
+\snippet doc/src/snippets/declarative/componentCreation.js vars
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js remote
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
\codeline
-\snippet doc/src/snippets/declarative/componentCreation.js 1
+\snippet doc/src/snippets/declarative/componentCreation.js finishCreation
-If you are certain the files will be local, you could simplify to:
+If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation()
+function and call \l {Component::createObject()}{createObject()} immediately:
-\snippet doc/src/snippets/declarative/componentCreation.js 2
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js local
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
-Notice that once a \c Sprite object is created, its parent is set to \c appWindow (defined
-in \c main.qml). After creating an item, you must set its parent to an item within the scene.
-Otherwise your dynamically created item will not appear in the scene.
+Notice in both instances, \l {Component::createObject()}{createObject()} is called with
+\c appWindow passed as an argument so that the created object will become a child of the
+\c appWindow item in \c main.qml. Otherwise, the new item will not appear in the scene.
When using files with relative paths, the path should
be relative to the file where \l {QML:Qt::createComponent()}{Qt.createComponent()} is executed.
-If the QML component does not exist until runtime, you can create a QML item from
+
+\section2 Creating an object from a string of QML
+
+If the QML is not defined until runtime, you can create a QML item from
a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
\snippet doc/src/snippets/declarative/createQmlObject.qml 0
The first argument is the string of QML to create. Just like in a new file, you will need to
-import any types you wish to use. For importing files with relative paths, the path should
-be relative to the file where the item in the second argument is defined. Remember to set the parent after
-creating the item. The second argument is another item in the scene, and the new item is created
-in the same QML Context as this item. The third argument is the file path associated with this
-item, which is used for error reporting.
+import any types you wish to use. The second argument is the parent item for the new item;
+this should be an existing item in the scene. The third argument is the file path to associate
+with the new item; this is used for error reporting.
+
+If the string of QML imports files using relative paths, the path should be relative
+to the file in which the parent item (the second argument to the method) is defined.
+
\section1 Maintaining Dynamically Created Objects
@@ -114,9 +131,9 @@ The actual creation context depends on how an item is created:
\o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context
is the QDeclarativeContext in which this method is called
\o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
- if called, it is the context of the item used as the second argument to this method
+ if called, the creation context is the context of the parent item passed to this method
\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
- is called on that item, it is the context in which the \c Component is defined
+ is called on that item, the creation context is the context in which the \c Component is defined
\endlist
Also, note that while dynamically created objects may be used the same as other objects, they
@@ -131,17 +148,47 @@ lots of dynamically created items, however, you may receive a worthwhile
performance benefit if unused items are deleted.
Note that you should never manually delete items that were dynamically created
-by QML elements (such as \l Loader). Also, you should generally avoid deleting
+by QML elements (such as \l Loader and \l Repeater). Also, you should avoid deleting
items that you did not dynamically create yourself.
Items can be deleted using the \c destroy() method. This method has an optional
argument (which defaults to 0) that specifies the approximate delay in milliseconds
-before the object is to be destroyed. This allows you to wait until the completion of
-an animation or transition. An example:
+before the object is to be destroyed.
+
+Here is an example. The \c application.qml creates five instances of the \c SelfDestroyingRect.qml
+component. Each instance runs a NumberAnimation, and when the animation has finished, calls
+\c destroy() on its root item to destroy itself:
+
+\table
+\row
+\o \c application.qml
+\o \c SelfDestroyingRect.qml
-\snippet doc/src/snippets/declarative/dynamicObjects.qml 0
+\row
+\o \snippet doc/src/snippets/declarative/dynamicObjects-destroy.qml 0
+\o \snippet doc/src/snippets/declarative/SelfDestroyingRect.qml 0
+
+\endtable
+
+Alternatively, the \c application.qml could have destroyed the created object
+by calling \c object.destroy().
+
+Notice that if a \c SelfDestroyingRect instance was created statically like this:
+
+\qml
+Item {
+ SelfDestroyingRect { ... }
+}
+\endqml
+
+This would result in an error, since items can only be dynamically
+destroyed if they were dynamically created.
+
+Objects created with \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+can similarly be destroyed using \c destroy():
+
+\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+\snippet doc/src/snippets/declarative/createQmlObject.qml destroy
-Here, \c Rectangle objects are destroyed one second after they are created, which is long
-enough for the \c NumberAnimation to be played before the object is destroyed.
*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 8a24228..9929cfe 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -175,6 +175,7 @@ The examples can be found in Qt's \c examples/declarative directory.
\list
\o \l{declarative/modelviews/gridview}{GridView}
\o \l{declarative/modelviews/listview}{ListView}
+\o \l{declarative/modelviews/pathview}{PathView}
\o \l{declarative/modelviews/package}{Package}
\o \l{declarative/modelviews/parallax}{Parallax}
\o \l{declarative/modelviews/visualitemmodel}{VisualItemModel}
@@ -202,6 +203,11 @@ The examples can be found in Qt's \c examples/declarative directory.
\o \l{declarative/threading/workerscript}{WorkerScript}
\endlist
+\section2 Screen orientation
+\list
+\o \l{declarative/screenorientation}{Example}
+\endlist
+
\section2 SQL Local Storage
\list
\o \l{declarative/sqllocalstorage}{Example}
diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index cc93e86..d128d0f 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -260,20 +260,34 @@ custom QML types may see unexpected behavior if bindings are not implemented.
\example declarative/tutorials/extending/chapter4-customPropertyTypes
The \c PieChart type currently has a string-type property and a color-type property.
-It could have many other types of properties. For example, we could add an
-integer-type property to store an identifier for each pie chart:
+It could have many other types of properties. For example, it could have an
+enum-type property to store a display mode for each chart:
\code
+ // C++
class PieChart : public QDeclarativeItem
{
+ Q_ENUMS(DisplayMode)
+ Q_PROPERTY(DisplayMode displayMode READ displayMode WRITE setDisplayMode)
...
- Q_PROPERTY(int id READ id WRITE setId)
+
public:
- ...
- int id() const;
- void setId(int id);
+ enum DisplayMode {
+ MultiLevel,
+ Exploded,
+ ThreeDimensional
+ };
+
+ void setDisplayMode(DisplayMode mode);
+ DisplayMode displayMode() const;
...
};
+
+ // QML
+ PieChart {
+ ...
+ displayMode: PieChart.Exploded
+ }
\endcode
We can also use various other property types. QML has built-in support for the following
@@ -407,7 +421,7 @@ To create a plugin library, we need:
\list
\o A plugin class that registers our QML types
\o A project file that describes the plugin
-\o A "qmldir" file that tells the QML engine to load the plugin
+\o A \l{Writing a qmldir file}{qmldir} file that tells the QML engine to load the plugin
\endlist
First, we create a plugin class named \c ChartsPlugin. It subclasses QDeclarativeExtensionPlugin
@@ -427,8 +441,8 @@ and specifies with DESTDIR that library files should be built into a "lib" subdi
\quotefile declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
-Finally, we add a \c qmldir file that is automatically parsed by the QML engine.
-Here, we specify that a plugin named "chapter6-plugin" (the name
+Finally, we add a \l{Writing a qmldir file}{qmldir} file that is automatically parsed by the QML engine.
+In this file, we specify that a plugin named "chapter6-plugin" (the name
of the example project) can be found in the "lib" subdirectory:
\quotefile declarative/tutorials/extending/chapter6-plugins/qmldir
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index 0dd5eb3..56ea165 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -73,12 +73,12 @@ See also the \l {Keys}{Keys attached property} and \l {KeyNavigation}{KeyNavigat
\section1 Querying the Active Focus Item
Whether or not an \l Item has \e {active focus} can be queried through the
-property \c {Item::focus}. For example, here we have a \l Text
+property \c {Item::activeFocus}. For example, here we have a \l Text
element whose text is determined by whether or not it has \e {active focus}.
\code
Text {
- text: focus ? "I have active focus!" : "I do not have active focus"
+ text: activeFocus ? "I have active focus!" : "I do not have active focus"
}
\endcode
@@ -174,7 +174,7 @@ Rectangle {
The right hand side of the example shows the expanded code - the equivalent QML
without the use of the component \c {MyWidget}. From this, the problem is
evident - there are no less than three elements that have the \c {Item::focus}
-property set to true. Ultimately only one element can have focus, and the
+property set to true. Ultimately only one element can have keyboard focus, and the
system has to decide which on. In this case the first appearance of the
\c {Item::focus} property being set to true on line 4 is selected, and the value
of \c {Item::focus} in the other two instances is reverted back to false. This
@@ -233,7 +233,7 @@ and the others are unset, just like when there are no \e {focus scopes}.
\o When a \e {focus scope} receives \e {active focus}, the contained element with
\c {Item::focus} set (if any) also gets \e {active focus}. If this element is
also a \l FocusScope, the proxying behaviour continues. Both the
-\e {focus scope} and the sub-focused item will have \c {Item::focus} set.
+\e {focus scope} and the sub-focused item will have \c {Item::activeFocus} set.
\endlist
So far the example has the second component statically selected. It is trivial
@@ -266,7 +266,7 @@ When a QML item explicitly relinquishes focus (by setting its
does not automatically select another element to receive focus. That is, it
is possible for there to be no currently \e {active focus}.
-See the {declarative/keyinteraction/focus}{Keyboard Focus example} for a
+See the \l{declarative/keyinteraction/focus}{Keyboard Focus example} for a
demonstration of moving keyboard focus between multiple areas using FocusScope
elements.
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
index c41e38e..18da3d2 100644
--- a/doc/src/declarative/javascriptblocks.qdoc
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -236,6 +236,31 @@ This restriction exists as the QML environment is not yet fully established.
To run code after the environment setup has completed, refer to
\l {Running JavaScript at Startup}.
+\o The value of \c this is currently undefined in QML
+
+The value of \c this is undefined in QML. To refer to any element, provide
+an \c id. For example:
+
+\qml
+Item {
+ width: 200; height: 100
+ function mouseAreaClicked(area) {
+ console.log("Clicked in area at: " + area.x + ", " + area.y);
+ }
+ // This will not work because this is undefined
+ MouseArea {
+ height: 50; width: 200
+ onClicked: mouseAreaClicked(this)
+ }
+ // This will pass area2 to the function
+ MouseArea {
+ id: area2
+ y: 50; height: 50; width: 200
+ onClicked: mouseAreaClicked(area2)
+ }
+}
+\endqml
+
\endlist
*/
diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc
index 938222a..9e51a40 100644
--- a/doc/src/declarative/modules.qdoc
+++ b/doc/src/declarative/modules.qdoc
@@ -30,152 +30,277 @@
\title Modules
\section1 QML Modules
-A \bold {QML module} is a collection of QML types. They allow you to organize your QML content
-into independent units. Modules have an optional versioning mechanism that allows for independent
+
+A module is a set of QML content files that can be imported as a unit into a QML
+application. Modules can be used to organize QML content into independent units,
+and they can use a versioning mechanism that allows for independent
upgradability of the modules.
-There are two types of modules:
-location modules (defined by a URL),
-and
-installed modules (defined by a URI).
+While QML component files within the same directory are automatically accessible
+within the global namespace, components defined elsewhere must be imported
+explicitly using the \c import statement to import them as modules. For
+example, an \c import statement is required to use:
+
+\list
+\o A component defined in another QML file that is not in the same directory
+\o A component defined in a QML file located on a remote server
+\o A \l{QDeclarativeExtensionPlugin}{QML C++ plugin} library (unless the plugin is installed in the same directory)
+\o A JavaScript file (note this must be imported using \l {#namespaces}{named imports})
+\endlist
+
+An \c import statement includes the module name, and possibly a version number.
+This can be seen in the snippet commonly found at the top of QML files:
+
+\qml
+ import Qt 4.7
+\endqml
+
+This imports version 4.7 of the "Qt" module into the global namespace. (The QML
+library itself must be imported to use any of the \l {QML Elements}, as they
+are not included in the global namespace by default.)
+
+The \c Qt module is an \e installed module; it is found in the
+\l{The QML import path}{import path}. There are two types of QML modules:
+location modules (defined by a URL) and installed modules (defined by a URI).
+
+
+\section1 Location Modules
+
+Location modules can reside on the local filesystem or a network resource,
+and are referred to by a quoted location URL that specifies the filesystem
+or network URL. They allow any directory with QML content to be imported
+as a module, whether the directory is on the local filesystem or a remote
+server.
+
+For example, a QML project may have a separate directory for a set of
+custom UI components. These components can be accessed by importing the
+directory using a relative or absolute path, like this:
+
+\table
+\row
+\o Directory structure
+\o Contents of application.qml
+
+\row
+\o
+\code
+MyQMLProject
+ |- MyComponents
+ |- Slider.qml
+ |- CheckBox.qml
+ |- Main
+ |- application.qml
+\endcode
+
+\o
+\code
+import "../MyComponents"
+
+Slider { ... }
+CheckBox { ... }
+\endcode
+
+\endtable
-Location modules types are defined in QML files and \l{QDeclarativeExtensionPlugin}{QML C++ plugins}
-in a directory refered to directly by
-the location URL, either on the local filesystem, or as a network resource. The URL that locates them
-can be relative, in which case they actual URL is resolved by the QML file containing the import.
-When importing a location module, a quoted URL is used:
+Similarly, if the directory resided on a network source, it could
+be imported like this:
\code
-import "https://qml.nokia.com/qml/example" 1.0
-import "https://qml.nokia.com/qml/example" as NokiaExample
-import "mymodule" 1.0
-import "mymodule"
+ import "https://qml.nokia.com/qml/qmlcomponents"
+ import "https://qml.nokia.com/qml/qmlcomponents" 1.0
\endcode
-Installed modules can \e only be on the local file system or in application C++ code. Again they
-are defined in QML files and \l{QDeclarativeExtensionPlugin}{QML C++ plugins} in a directory,
-but the directory is indirectly referred to by the URI. The mapping to actual content is either
-by application C++ code registering a C++ type to a module URI (see \l{Extending QML in C++}),
-or in the referenced subdirectory of a path on the import path (see below).
-When importing a location module, an un-quoted URI is used:
+Remote location modules must have a \l{Writing a qmldir file}{qmldir file} in the
+same directory to specify which QML files should be made available. See the
+\l {#qmldirexample}{example} below. The qmldir file is optional for modules on
+the local filesystem.
+
+
+
+\section1 Installed modules
+
+
+Installed modules are modules that are installed on the
+local filesystem within the QML import path, or modules defined in C++
+application code. When importing an installed module, an un-quoted URI is
+used, with a mandatory version number:
\code
-import com.nokia.qml.mymodule 1.0
-import com.nokia.qml.mymodule as MyModule
+ import Qt 4.7
+ import com.nokia.qml.mymodule 1.0
\endcode
+Installed modules that are installed into the import path or created
+as a \l{QDeclarativeExtensionPlugin}{QML C++ plugin} must define a
+\l{Writing a qmldir file}{qmldir file}.
+
+
+\section2 The QML import path
-For either type of module, a \c qmldir file in the module directory defines the content of the module. This file is
-optional for location modules, but only for local filesystem content or a single remote content with a namespace.
-The second exception is explained in more detail in the section below on Namespaces.
+The QML engine will search the import path for a requested installed module.
+The default import path includes:
-\section2 The Import Path
+\list
+\o The directory of the current file
+\o The location specified by QLibraryInfo::ImportsPath
+\o Paths specified by the \c QML_IMPORT_PATH environment variable
+\endlist
-Installed modules are searched for on the import path.
-The \c -I option to the \l {QML Viewer} adds paths to the import path.
+The import path can be queried using QDeclarativeEngine::importPathList() and modified using QDeclarativeEngine::addImportPath().
-From C++, the path is available via \l QDeclarativeEngine::importPathList() and can be prepended to
-using \l QDeclarativeEngine::addImportPath().
+When running the \l {QML Viewer}, use the \c -I option to add paths to the import path.
-\section2 The \c qmldir File
-Installed QML modules and remote content without a namespace require a file \c qmldir which
-specifies the mapping from all type names to versioned QML files. It is a list of lines of the form:
+\section2 Creating installed modules in C++
+
+C++ applications can dynamically define installed modules using
+qmlRegisterType().
+
+For \l{QDeclarativeExtensionPlugin}{QML C++ plugins}, the
+module URI is automatically passed to QDeclarativeExtensionPlugin::registerTypes().
+The QDeclarativeExtensionPlugin documentation shows how to use this URI
+to call qmlRegisterType() to enable the plugin library to be built as
+an installed module. Once the plugin is built and installed, the module is importable
+in QML, like this:
+
+\code
+import com.nokia.TimeExample 1.0
+\endcode
+
+A \l{QDeclarativeExtensionPlugin}{QML C++ plugin} also requires a
+\l{Writing a qmldir file}{qmldir file} to make it available to the
+QML engine.
+
+
+
+\target namespaces
+\section1 Namespaces: Using Named Imports
+
+By default, when a module is imported, its contents are imported into the global namespace. You may choose to import the module into another namespace, either to allow identically-named types to be referenced, or purely for readability.
+
+To import a module into a specific namespace, use the \e as keyword:
+
+\qml
+ import Qt 4.7 as QtLibrary
+ import "../MyComponents" as MyComponents
+ import com.nokia.qml.mymodule 1.0 as MyModule
+\endqml
+
+Types from these modules can then only be used when qualified by the namespace:
+
+\qml
+ QtLibrary.Rectangle { ... }
+
+ MyComponents.Slider { ... }
+
+ MyModule.SomeComponent { ... }
+\endqml
+
+Multiple modules can be imported into the same namespace in the same way that multiple modules can be imported into the global namespace:
+
+\qml
+ import Qt 4.7 as Nokia
+ import Ovi 1.0 as Nokia
+\endqml
+
+\section2 JavaScript files
+
+JavaScript files must always be imported with a named import:
+
+\qml
+ import "somescript.js" as MyScript
+
+ Item {
+ //...
+ Component.onCompleted: MyScript.doSomething()
+ }
+\endqml
+
+
+
+\section1 Writing a qmldir file
+
+A \c qmldir file is a metadata file for a module that maps all type names in
+the module to versioned QML files. It is required for installed modules, and
+location modules that are loaded from a network source.
+
+It is defined by a plain text file named "qmldir" that contains one or more lines of the form:
\code
# <Comment>
<TypeName> [<InitialVersion>] <File>
-internal <Name> <File>
+internal <TypeName> <File>
plugin <Name> [<Path>]
\endcode
-# <Comment> lines are ignored, and can be used for comments.
+\bold {# <Commment>} lines are used for comments. They are ignored by the QML engine.
-<TypeName> <InitialVersion> <File> lines are used to add QML files as types.
-<TypeName> is the type being made available; the optional <InitialVersion> is a version
-number like \c 4.0; <File> is the (relative)
-file name of the QML file defining the type.
+\bold {<TypeName> [<InitialVersion>] <File>} lines are used to add QML files as types.
+<TypeName> is the type being made available, the optional <InitialVersion> is a version
+number, and <File> is the (relative) file name of the QML file defining the type.
Installed files do not need to import the module of which they are a part, as they can refer
to the other QML files in the module as relative (local) files, but
if the module is imported from a remote location, those files must nevertheless be listed in
the \c qmldir file. Types which you do not wish to export to users of your module
-may be marked with the \c internal keyword: \c internal <TypeName> <File>.
+may be marked with the \c internal keyword: \bold {internal <TypeName> <File>}.
The same type can be provided by different files in different versions, in which
case later versions (eg. 1.2) must precede earlier versions (eg. 1.0),
since the \e first name-version match is used and a request for a version of a type
can be fulfilled by one defined in an earlier version of the module. If a user attempts
to import a version earlier than the earliest provided or later than the latest provided,
-an error results, but if the user imports a version within the range of versions provided,
-even if no type is specific to that version, no error results.
+the import produces a runtime error, but if the user imports a version within the range of versions provided,
+even if no type is specific to that version, no error will occur.
A single module, in all versions, may only be provided in a single directory (and a single \c qmldir file).
If multiple are provided, only the first in the search path will be used (regardless of whether other versions
are provided by directories later in the search path).
-Installed and remote files without a namespace \e must be referred to by version information described above,
-local files \e may have it.
-
The versioning system ensures that a given QML file will work regardless of the version
of installed software, since a versioned import \e only imports types for that version,
leaving other identifiers available, even if the actual installed version might otherwise
provide those identifiers.
-\c plugin <Name> [<Path>] lines are used to add \l{QDeclarativeExtensionPlugin}{QML C++ plugins}
-to the module.
-
-<Name> is the name of the library. It is usually not the same as the file name
-of the plugin binary, which is platform dependent; e.g. the library MyAppTypes would produce
-a libMyAppTypes.so on Linux and MyAppTypes.dll on Windows.
-By default the engine searches for the plugin library in the directory containing the \c qmldir
-file. The \c -P option to the \l {QML Viewer} adds paths to the
-plugin search path.
-From C++, the path is available via \l QDeclarativeEngine::pluginPathList() and can be prepended to
-using \l QDeclarativeEngine::addPluginPath().
+\bold {plugin <Name> [<Path>]} lines are used to add \l{QDeclarativeExtensionPlugin}{QML C++ plugins} to the module. <Name> is the name of the library. It is usually not the same as the file name
+of the plugin binary, which is platform dependent; e.g. the library \c MyAppTypes would produce
+\c libMyAppTypes.so on Linux and \c MyAppTypes.dll on Windows.
<Path> is an optional argument specifying either an absolute path to the directory containing the
plugin file, or a relative path from the directory containing the \c qmldir file to the directory
-containing the plugin file.
-
+containing the plugin file. By default the engine searches for the plugin library in the directory that contains the \c qmldir
+file. The plugin search path can be queried with QDeclarativeEngine::pluginPathList() and modified using QDeclarativeEngine::addPluginPath(). When running the \l {QML Viewer}, use the \c -P option to add paths to the plugin search path.
-\section2 Namespaces - Named Imports
-When importing content it by default imports types into the global namespace.
-You may choose to import the module into another namespace, either to allow identically-named
-types to be referenced, or purely for readability.
+\target qmldirexample
+\section2 Example
-To import a module into a namespace:
+If the components in the \c MyComponents directory from the
+\l{Location Modules}{earlier example} were to be made available as a network resource,
+the directory would need to contain a \c qmldir file similar to this:
\code
-import Qt 4.7 as TheQtLibrary
+ComponentA 1.0 ComponentA.qml
+ComponentB 1.0 ComponentB.qml
\endcode
-Types from the Qt 4.7 module may then be used, but only by qualifying them with the namespace:
+The \c MyComponents directory could then be imported as a module using:
\code
-TheQtLibrary.Rectangle { ... }
-\endcode
-
-Multiple modules can be imported into the same namespace in the same way that multiple
-modules can be imported into the global namespace:
+import "http://the-server-name.com/MyComponents"
-\code
-import Qt 4.7 as Nokia
-import Ovi 1.0 as Nokia
+Slider { ... }
+CheckBox { ... }
\endcode
-While import statements are needed to make any types available in QML, the directory of the
-current file is implicitly loaded. This is the exact same as if you had added 'import "."' to
-the start of every QML file. The effect of this is that you can automatically use types defined in C++ plugins
-or QML files if they reside in the same directory. This is the last location searched for types - so if you
-happen to have a "Text.qml" file, or "text.qml" on case-insensitive file systems, it will not override
-the one from Qt if you import Qt.
-
-*/
+with an optional "1.0" version specification. Notice the import fails if
+a later version is used, as the \c qmldir file specifies that these elements
+are only available in the 1.0 version.
-/*
-Original requirement is QT-558.
+For examples of \c qmldir files for plugins, see the
+\l {declarative/cppextensions/plugins}{Plugins} example and
+\l {Tutorial: Writing QML extensions with C++}.
*/
+/
diff --git a/doc/src/declarative/pics/anatomy-component.png b/doc/src/declarative/pics/anatomy-component.png
index 70ed983..6125b00 100644
--- a/doc/src/declarative/pics/anatomy-component.png
+++ b/doc/src/declarative/pics/anatomy-component.png
Binary files differ
diff --git a/doc/src/declarative/qdeclarativedocument.qdoc b/doc/src/declarative/qdeclarativedocument.qdoc
index a2ed205..068297a 100644
--- a/doc/src/declarative/qdeclarativedocument.qdoc
+++ b/doc/src/declarative/qdeclarativedocument.qdoc
@@ -73,51 +73,61 @@ document - such as \c Rectangle and \c ListView - including those made within an
import statements. QML does not import any modules by default, so at least one \c import
statement must be present or no elements will be available!
+Each \c id value in a QML document must be unique within that document. They
+do not need to be unique across different documents as id values are
+resolved according to the document scope.
+
+
+\section1 Documents as Component Definitions
+
A QML document defines a single, top-level \l {QDeclarativeComponent}{QML component}. A QML component
is a template that is interpreted by the QML runtime to create an object with some predefined
behaviour. As it is a template, a single QML component can be "run" multiple times to
produce several objects, each of which are said to be \e instances of the component.
Once created, instances are not dependent on the component that created them, so they can
-operate on independent data. Here is an example of a simple "Button" component that is
-instantiated four times, each with a different value for its \c text property.
+operate on independent data. Here is an example of a simple "Button" component (defined
+in a \c Button.qml file) that is instantiated four times by \c application.qml.
+Each instance is created with a different value for its \c text property:
-\raw HTML
-<table><tr><td>
-\endraw
-\code
+\table
+\row
+\o Button.qml
+\o application.qml
+
+\row
+\o \snippet doc/src/snippets/declarative/qmldocuments.qml 0
+\o
+\qml
import Qt 4.7
-BorderImage {
- property alias text: textElement.text
- width: 100; height: 30; source: "images/toolbutton.sci"
-
- Text {
- id: textElement
- anchors.centerIn: parent
- font.pointSize: 20
- style: Text.Raised
- color: "white"
- }
+Column {
+ spacing: 10
+
+ Button { text: "Apple" }
+ Button { text: "Orange" }
+ Button { text: "Pear" }
+ Button { text: "Grape" }
}
-\endcode
-\raw HTML
-</td> <td>
-\endraw
+\endqml
+
\image anatomy-component.png
-\raw HTML
-</td> </tr> </table>
-\endraw
+
+\endtable
Any snippet of QML code can become a component, just by placing it in the file "<Name>.qml"
-where <Name> is the new element name, and begins with an uppercase letter. Note that
+where <Name> is the new element name, and begins with an \bold uppercase letter. Note that
the case of all characters in the <Name> are significant on some filesystems, notably
UNIX filesystems. It is recommended that the case of the filename matches the case of
the component name in QML exactly, regardless of the platform the QML will be deployed to.
-These QML files automatically become available as new QML element types
+These QML component files automatically become available as new QML element types
to other QML components and applications in the same directory.
+
+
+\section1 Inline Components
+
In addition to the top-level component that all QML documents define, and any reusable
components placed in separate files, documents may also
include \e inline components. Inline components are declared using the
diff --git a/doc/src/declarative/qdeclarativei18n.qdoc b/doc/src/declarative/qdeclarativei18n.qdoc
index b6e6c6e..70a3587 100644
--- a/doc/src/declarative/qdeclarativei18n.qdoc
+++ b/doc/src/declarative/qdeclarativei18n.qdoc
@@ -80,5 +80,5 @@ qmlviewer -translation hello.qm hello.qml
\endcode
-You can see a complete example and source code in the {declarative/i18n}{QML Internationalization example}.
+You can see a complete example and source code in the \l{declarative/i18n}{QML Internationalization example}.
*/
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index 3f1b184..fa42f59 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -87,6 +87,10 @@ Rectangle { width: 100; height: 100 }
When multiple property/value pairs are specified on a single line, they
must be separated by a semicolon.
+The \c import statement imports the \c Qt \l{QML Modules}{module}, which contains all of the
+standard \l {QML Elements}. Without this import statement, the \l Rectangle
+and \l Image elements would not be available.
+
\section1 Expressions
In addition to assigning values to properties, you can also assign
@@ -129,7 +133,7 @@ Commenting in QML is similar to JavaScript.
\o Multiline comments start with /* and finish with *\/
\endlist
-\quotefile doc/src/snippets/declarative/comments.qml
+\snippet doc/src/snippets/declarative/comments.qml 0
Comments are ignored by the engine. They are useful for explaining what you
are doing; for referring back to at a later date, or for others reading
@@ -181,7 +185,8 @@ Item {
\section3 The \c id property
-Each object can be given a special unique property called an \e id. Assigning an id enables the object
+Each object can be given a special unique property called an \e id. No other object within the
+same \l{QML Documents}{QML document} can have the same \c id value. Assigning an id enables the object
to be referred to by other objects and scripts.
The first Rectangle element below has an \e id, "myRect". The second Rectange element defines its
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index a2f4d3a..173002a 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -208,7 +208,10 @@ Models can be defined in C++ and then made available to QML. This is useful
for exposing existing C++ data models or otherwise complex datasets to QML.
A C++ model class can be defined as a QStringList, a QList<QObject*> or a
-QAbstractItemModel.
+QAbstractItemModel. The first two are useful for exposing simpler datasets,
+while QAbstractItemModel provides a more flexible solution for more complex
+models.
+
\section2 QStringList
@@ -268,7 +271,10 @@ the model by calling QDeclarativeContext::setContextProperty() again.
\section2 QAbstractItemModel
-A model can be defined by subclassing QAbstractItemModel.
+A model can be defined by subclassing QAbstractItemModel. This is the
+best approach if you have a more complex model that cannot be supported
+by the other approaches. A QAbstractItemModel can also automatically
+notify a QML view when the model data has changed.
The roles of a QAbstractItemModel subclass can be exposed to QML by calling
QAbstractItemModel::setRoleNames(). The default role names set by Qt are:
@@ -305,6 +311,12 @@ roles:
\snippet examples/declarative/modelviews/abstractitemmodel/view.qml 0
+QML views are automatically updated when the model changes. Remember the model
+must follow the standard rules for model changes and notify the view when
+the model has changed by using QAbstractItemModel::dataChanged(),
+QAbstractItemModel::beginInsertRows(), etc. See the \l {Model subclassing reference} for
+more information.
+
The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/declarative/modelviews/abstractitemmodel} directory.
QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML
diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc
index 6461925..0b91756 100644
--- a/doc/src/declarative/qdeclarativestates.qdoc
+++ b/doc/src/declarative/qdeclarativestates.qdoc
@@ -32,57 +32,174 @@
\section1 Overview
-QML states typically describe user interface configurations, including:
+User interfaces are designed to present different interface configurations in
+different scenarios, or to modify their appearances in response to user
+interaction. Often, there are a set of changes that are made concurrently, such
+that the interface could be seen to be internally changing from one \e state to
+another.
+
+This applies generally to interface elements regardless of their complexity.
+A photo viewer may initially present images in a grid, and when an image is
+clicked, change to a "detailed" state where the individual image is expanded
+and the interface is changed to present new options for image editing. On the
+other end of the scale, when a simple button is pressed, it may change to a
+"pressed" state in which its color and position is modified to give a pressed
+appearance.
+
+In QML, any object can change between different \e states to apply sets of
+changes that modify the properties of relevant items. Each \e state could
+present a different configuration that could, for example:
+
\list
-\o What UI elements are present
-\o The properties of those elements (including how they behave)
-\o What actions are available
+\o Show some UI elements and hide others
+\o Present different available actions to the user
+\o Start, stop or pause animations
+\o Execute some script required in the new state
+\o Change a property value for a particular item
+\o Show a different view or "screen"
\endlist
-A state can also be thought of as a set of batched changes from a default configuration.
+Changes between states can be animated using \l {Transitions}{transitions}, as
+discussed further below.
-Examples of states in modern UI:
-\list
-\o An Address Book application with a 'View Contact' state and an 'Edit Contact' State. In the first state the contact information presented is read-only (using labels), and in the second it is editable (using editors).
-\o A button with a pressed and unpressed state. When pressed the text moves slightly down and to the right, and the button has a slightly darker appearance.
-\endlist
+All \l {Item}-based objects have a \e {default state}, and can specify additional
+states by adding new \l State objects to the item's \l {Item::}{states}
+property. Each state has a \e name that is unique for all states within that
+item; the default state's name is an empty string. To change the current state
+of an item, set the \l {Item::}{state} property to the name of the state.
+
+Non-Item objects can use states through the StateGroup element.
-\section1 States in QML
-In QML:
+\section1 Creating states
+
+To create a state, add a \l State object to the item's \l {Item::}{states} property,
+which holds a list of states for that item.
+
+Following is an example. Here, the \l Rectangle is initially placed in the
+default (0, 0) position. It has defined an additional state named "moved", in
+which a PropertyChanges object repositions the rectangle to (50, 50). Clicking
+within the MouseArea changes the state to the "moved" state, thus moving the \l
+Rectangle.
+
+\snippet doc/src/snippets/declarative/states.qml 0
+
+A \l State item defines all the changes to be made in the new state. You
+could specify additional properties to be changed, or create additional
+PropertyChanges for other objects. (Note that a \l State can modify the
+properties of other objects, not just the object that owns the state.)
+
+For example:
+
+\qml
+State {
+ name: "moved"
+ PropertyChanges { target: myRect; x: 50; y: 50; color: "blue" }
+ PropertyChanges { target: someOtherItem; width: 1000 }
+}
+\endqml
+
+A \l State is not limited to performing modifications on property values. It
+can also:
+
\list
-\o Any object can use states.
-\o There is a default state. The default state can be explicitly set.
-\o A state can affect the properties of other objects, not just the object owning the state (and not just that object's children).
+\o Run some script using StateChangeScript
+\o Override an existing signal handler for an object using PropertyChanges
+\o Re-parent an \l Item using ParentChanges
+\o Modify anchor values using AnchorChanges
\endlist
-To define a state for an item, add a \l State element to the \l{Item::states}{states} property. To
-change the current state of an \l Item, set the \l{Item::state}{state} property to the name
-of the required state.
+The \l {declarative/animation/states}{States and Transitions example}
+demonstrates how to declare a basic set of states and apply animated
+transitions between them.
-Here is an example of using states. In the default state \c myRect is positioned at 0,0. In the 'moved' state it is positioned at 50,50. Clicking within the mouse area changes the state from the default state to the 'moved' state, thus moving the rectangle.
-\snippet doc/src/snippets/declarative/states.qml 0
-\snippet doc/src/snippets/declarative/states.qml 1
+\section1 The default state
-State changes can be animated using \l{state-transitions}{Transitions}.
+Of course, the \l Rectangle in the example above could have simply been moved
+by setting its position to (50, 50) in the mouse area's \c onClicked handler.
+However, aside from enabling batched property changes, the use of states allows
+an item to revert to its \e {default state}, which contains all of the items'
+initial property values before they were modified in a state change.
-For example, adding this code to the above \c Item element animates the transition to the "moved" state:
+The default state is specified by an empty string. If the MouseArea in the
+above example was changed to this:
-\snippet doc/src/snippets/declarative/states.qml transitions
+\qml
+MouseArea {
+ anchors.fill: parent
+ onClicked: myRect.state == 'moved' ? myRect.state = "" : myRect.state = 'moved';
+}
+\endqml
-See \l{state-transitions}{Transitions} for more information.
+This would toggle the \l Rectangle's state between the \e moved and \e default
+states when clicked. The properties can be reverted to their initial
+values without requiring the definition of another \l State that defines these
+value changes.
-Other things you can do in a state change:
-\list
-\o Override signal handlers with PropertyChanges
-\o Change an item's visual parent with ParentChange
-\o Change an item's anchors with AnchorChanges
-\o Run some script with StateChangeScript
-\endlist
+\section1 The "when" property
+
+The \l {State::}{when} property is useful for specifying when a state should be
+applied. This can be set to an expression that evaluates to \c true when an
+item should change to a particular state.
+
+If the above example was changed to this:
+
+\qml
+Rectangle {
+ ...
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "moved"; when: mouseArea.pressed
+ ...
+ }
+\endqml
+
+The \l Rectangle would automatically change to the \e moved state when the
+mouse is pressed, and revert to the default state when it is released. This is
+simpler (and a better, more declarative method) than creating \c onPressed
+and \c onReleased handlers in the MouseArea to set the current state.
+
+
+\section1 Animating state changes
+
+
+State changes can be easily animated through \l {Transitions}{transitions}. A
+\l Transition defines the animations that should be applied when an item
+changes from one state to another.
+
+If the above example was modified to include the following \l Transition, the
+movement of the \l Rectangle would be animated:
+
+\qml
+Rectangle {
+ ...
+
+ MouseArea { ... }
+
+ states: [
+ ...
+ ]
+
+ transitions: [
+ Transition {
+ NumberAnimation { properties: "x,y"; duration: 500 }
+ }
+ ]
+ }
+\endqml
+
+This \l Transition defines that if any \c x or \c y properties have changed
+during a state change within this item, their values should be animated over 500
+millliseconds.
-The {declarative/animation/states}{States and Transitions example} demonstrates how to declare a basic set of states and then apply animated transitions between them.
+See the \l Transitions documentation for more information.
*/
diff --git a/doc/src/declarative/qmlviewer.qdoc b/doc/src/declarative/qmlviewer.qdoc
index 5efc0ce..41c4c80 100644
--- a/doc/src/declarative/qmlviewer.qdoc
+++ b/doc/src/declarative/qmlviewer.qdoc
@@ -197,10 +197,10 @@ Rectangle {
\o \c runtime.orientation
\o This property indicates the current orientation of the QML Viewer. On the
-N900 platform, this property automatically updates to reflect the device's
-actual orientation; on other platforms, this indicates the orientation currently
-selected in the QML Viewer's \e {Settings -> Properties} menu. The
-\c orientation value can be one of the following:
+N900 platform and most S60 5.0-based or newer Symbian devices, this property
+automatically updates to reflect the device's actual orientation; on other platforms,
+this indicates the orientation currently selected in the QML Viewer's
+\e {Settings -> Properties} menu. The \c orientation value can be one of the following:
\list
\o \c Orientation.Portrait
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index fb50286..413eb59 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -70,13 +70,23 @@
Returns the QML type id.
- Example: Register the C++ class \c MinehuntGame as the QML type
- named \c Game for version 0.1 in the import library \c MinehuntCore:
+ For example, this registers a C++ class \c MySliderItem as a QML type
+ named \c Slider for version 1.0 of a \l{QML Modules}{module} called
+ "com.mycompany.qmlcomponents":
\code
- qmlRegisterType<MinehuntGame>("MinehuntCore", 0, 1, "Game");
+ qmlRegisterType<MySliderItem>("com.mycompany.qmlcomponents", 1, 0, "Slider");
\endcode
+ Once this is registered, the type can be used in QML by importing the
+ specified module name and version number:
+
+ \qml
+ imoprt com.mycompany.qmlcomponents 1.0
+
+ Slider { ... }
+ \endqml
+
Note that it's perfectly reasonable for a library to register types to older versions
than the actual version of the library. Indeed, it is normal for the new library to allow
QML written to previous versions to continue to work, even if more advanced versions of
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
index 7a97eb1..f913d44 100644
--- a/doc/src/declarative/tutorial.qdoc
+++ b/doc/src/declarative/tutorial.qdoc
@@ -222,5 +222,5 @@ This is equivalent to writing the two transitions separately.
The \l ParallelAnimation element makes sure that the two types of animations (number and color) start at the same time.
We could also run them one after the other by using \l SequentialAnimation instead.
-For more details on states and transitions, see \l {QML States} and the {declarative/animation/states}{states and transitions example}.
+For more details on states and transitions, see \l {QML States} and the \l{declarative/animation/states}{states and transitions example}.
*/
diff --git a/doc/src/development/debug.qdoc b/doc/src/development/debug.qdoc
index 36970ee..9e881d1 100644
--- a/doc/src/development/debug.qdoc
+++ b/doc/src/development/debug.qdoc
@@ -49,7 +49,7 @@
The basic stuff you need to know about debug libraries and
frameworks is found at developer.apple.com in:
\l{http://developer.apple.com/technotes/tn2004/tn2124.html#SECDEBUGLIB}
- {Apple Technicle Note TN2124} Qt follows that.
+ {Apple Technical Note TN2124}.
When you build Qt, frameworks are built by default, and inside the
framework you will find both a release and a debug version (e.g.,
diff --git a/doc/src/development/developing-with-qt.qdoc b/doc/src/development/developing-with-qt.qdoc
index ffc5a8e..f9b38b8 100644
--- a/doc/src/development/developing-with-qt.qdoc
+++ b/doc/src/development/developing-with-qt.qdoc
@@ -27,12 +27,22 @@
/*!
\page developing-with-qt.html
- \title Cross Platform Development with Qt
+
+ \title Cross-platform & Platform-specific Development
+ Qt allows you to write advanced applications and UIs once, and deploy them
+ across desktop and embedded operating systems without rewriting the source
+ code. The top section of this page provides an overview of the tools and
+ techniques used in Qt application development. Still, you might want to add
+ platform-specific features to your code. The bottom section of the page
+ links to documents that describe platform-specific features provided by Qt,
+ and discuss issues related to particular platforms and environments.
+
+ \section1 Cross-platform Development with Qt
Qt is provided with a set of build tools to help developers automate
the process of building and installing Qt applications.
- \table 100%
+ \table
\header \o Development \o Cross-Platform Issues \o Specific Tools
\row
\o
@@ -57,4 +67,49 @@
\o \l {Resource Compiler (rcc)}
\endlist
\endtable
-*/
+
+ \section1 Platform-specific Development with Qt
+
+ These documents describe platform-specific features provided by Qt, and
+ discuss issues related to particular platforms and environments.
+
+ \table
+ \row
+ \o
+ \list
+ \o \l {Calling Qt Functions From Unix Signal Handlers}
+ \o \l {Compiler Notes}
+ \o \l {Developing Qt Applications for Mac OS X}
+ \o \l {Known Issues}
+ \o \l {Platform Notes}
+ \o \l {Platform Notes - Symbian}
+ \o \l {Qt For ActiveX}
+ \o \l {Qt for Embedded Linux Classes}
+ \o \l {Qt for Embedded Platforms}
+ \o \l {Qt for Mac OS X - Specific Issues}
+ \o \l {Qt is Mac OS X Native}
+ \o \l {Supported Platforms}
+ \o \l {The qtmain Library}
+ \o \l {Window System Specific Notes}
+ \endlist
+ \o
+ \list
+ \o Workaround to make it work.
+ \o Information about the C++ compilers and tools used to build Qt.
+ \o Information for developing Qt applications for Mac OS X
+ \o A summary of known issues in this Qt version at the time of release.
+ \o Information about the platforms on which Qt can be used.
+ \o Information about the state of support for the Symbian platform.
+ \o Qt API's for using ActiveX controls, servers, and COM.
+ \o Classes that are specific to Qt for Embedded Linux.
+ \o Documents related to Qt for Embedded Platforms.
+ \o A description of issues with Qt that are specific to Mac OS X.
+ \o An explanation of Qt's native features on Mac OS X.
+ \o The platforms supported by Nokia for Qt.
+ \o Describes the use and license of the qtmain helper library.
+ \o Collections of notes about Qt implementations on different window systems.
+ \endlist
+ \endtable
+
+
+*/ \ No newline at end of file
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index 0fdeff8..baa30fc 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -3015,6 +3015,13 @@ For example:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 150
+ \target SYMBIAN_VERSION
+ \section1 SYMBIAN_VERSION
+
+ \e {This is only used on the Symbian platform.}
+
+ Contains the version number of the underlying Symbian SDK; e.g. "9.2" or "Symbian3".
+
\target TARGET
\section1 TARGET
diff --git a/doc/src/examples/fingerpaint.qdoc b/doc/src/examples/fingerpaint.qdoc
index f438082..4b62570 100644
--- a/doc/src/examples/fingerpaint.qdoc
+++ b/doc/src/examples/fingerpaint.qdoc
@@ -26,11 +26,11 @@
****************************************************************************/
/*!
- \example multitouch/fingerpaint
+ \example touch/fingerpaint
\title Finger Paint Example
- The Finger Paint example shows the use of multi-touch with a custom widget
+ The Finger Paint example shows the use of touch with a custom widget
to create a simple painting application.
- \image multitouch-fingerpaint-example.png
+ \image touch-fingerpaint-example.png
*/
diff --git a/doc/src/examples/pinchzoom.qdoc b/doc/src/examples/pinchzoom.qdoc
index e091230..198cbb3 100644
--- a/doc/src/examples/pinchzoom.qdoc
+++ b/doc/src/examples/pinchzoom.qdoc
@@ -26,11 +26,11 @@
****************************************************************************/
/*!
- \example multitouch/pinchzoom
+ \example touch/pinchzoom
\title Pinch Zoom Example
- The Pinch Zoom example shows how to use low-level multi-touch information
+ The Pinch Zoom example shows how to use low-level touch information
to recognize a gesture.
- \image multitouch-pinchzoom-example.png
+ \image touch-pinchzoom-example.png
*/
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index db6e657..8d3aa25 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \title Animation: Basics
+ \title Animation: Basics Example
\example declarative/animation/basics
This example shows how to create and combine \l{QML Animation}{animations} in QML.
@@ -47,7 +47,7 @@
*/
/*!
- \title Animation: Behaviors
+ \title Animation: Behavior Examples
\example declarative/animation/behaviors
This example shows how to use QML behaviors.
@@ -56,7 +56,7 @@
*/
/*!
- \title Animation: Easing
+ \title Animation: Easing Example
\example declarative/animation/easing
This example shows the different easing modes available for \l{QML Animation}{animations}.
@@ -65,7 +65,7 @@
*/
/*!
- \title Animation: States
+ \title Animation: States Example
\example declarative/animation/states
These examples show how to use \l{States}{states} and \l{Transitions}{transitions}.
@@ -89,7 +89,7 @@
*/
/*!
- \title Image Elements: Border Image
+ \title Image Elements: Border Image Example
\example declarative/imageelements/borderimage
These examples show how to use the BorderImage element.
@@ -110,7 +110,7 @@
*/
/*!
- \title Image Elements: Image
+ \title Image Elements: Image Example
\example declarative/imageelements/image
This example shows how to use the \l Image element and its \l{Image::fillMode}{fillModes}.
@@ -147,7 +147,7 @@
*/
/*!
- \title C++ Extensions: Plugins
+ \title C++ Extensions: Plugins Example
\example declarative/cppextensions/plugins
This example shows how to create a C++ plugin extension by subclassing QDeclarativeExtensionPlugin.
@@ -156,7 +156,7 @@
*/
/*!
- \title LayoutItem
+ \title LayoutItem Example
\example declarative/cppextensions/qgraphicslayouts/layoutitem
This example show how to use the LayoutItem element to integrate QML items into an existing
@@ -165,6 +165,7 @@
\image qml-layoutitem-example.png
*/
/*!
+ \title QGraphicsGridLayout Example
\example declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout
This example shows how to use QGraphicsGridLayout to lay out QML items. This is
@@ -174,7 +175,7 @@
\image qml-qgraphicsgridlayout-example.png
*/
/*!
- \title QGraphicsLinearLayout
+ \title QGraphicsLinearLayout Example
\example declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout
This example shows how to use QGraphicsLinearLayout to lay out QML items. This is
@@ -184,8 +185,8 @@
\image qml-qgraphicslinearlayout-example.png
*/
/*!
+ \title C++ Extensions: QGraphicsLayouts examples
\page declarative-cppextensions-qgraphicslayouts.html
- \title C++ Extensions: QGraphicsLayouts
These examples show how to integrate \l{Graphics View Framework}{Graphics View}
layout components with QML:
@@ -201,7 +202,7 @@
*/
/*!
- \title C++ Extensions: QWidgets
+ \title C++ Extensions: QWidgets Example
\example declarative/cppextensions/qwidgets
This example shows how to embed QWidget-based objects into QML using QGraphicsProxyWidget.
@@ -210,7 +211,7 @@
*/
/*!
- \title C++ Extensions: Image Provider
+ \title C++ Extensions: Image Provider Example
\example declarative/cppextensions/imageprovider
This examples shows how to use QDeclarativeImageProvider to serve images
@@ -220,7 +221,7 @@
*/
/*!
- \title C++ Extensions: Network access manager factory
+ \title C++ Extensions: Network Access Manager Factory Example
\example declarative/cppextensions/networkaccessmanagerfactory
This example shows how to use QDeclarativeNetworkAccessManagerFactory to create a QNetworkAccessManager
@@ -228,7 +229,7 @@
*/
/*!
- \title Internationlization
+ \title Internationlization Example
\example declarative/i18n
This example shows how to enable text translation in QML.
@@ -237,7 +238,7 @@
*/
/*!
- \title Positioners
+ \title Positioners Example
\example declarative/positioners
This example shows how to use positioner elements such as \l Row, \l Column,
@@ -247,7 +248,7 @@
*/
/*!
- \title Key Interaction: Focus
+ \title Key Interaction: Focus Example
\example declarative/keyinteraction/focus
This example shows how to handle keyboard input and focus in QML.
@@ -256,7 +257,7 @@
*/
/*!
- \title Models and Views: AbstractItemModel
+ \title Models and Views: AbstractItemModel Example
\example declarative/modelviews/abstractitemmodel
This example shows how to use a QAbstractItemModel subclass as a model in QML.
@@ -265,7 +266,7 @@
*/
/*!
- \title Models and Views: GridView
+ \title Models and Views: GridView Example
\example declarative/modelviews/gridview
This example shows how to use the GridView element.
@@ -274,7 +275,7 @@
*/
/*!
- \title Models and Views: ListView
+ \title Models and Views: ListView Example
\example declarative/modelviews/listview
These examples show how to use the ListView element.
@@ -316,7 +317,16 @@
*/
/*!
- \title Models and Views: Object ListModel
+ \title Models and Views: PathView Example
+ \example declarative/modelviews/pathview
+
+ This example shows how to use the PathView element.
+
+ \image qml-pathview-example.png
+*/
+
+/*!
+ \title Models and Views: Object ListModel Example
\example declarative/modelviews/objectlistmodel
This example shows how to use a QList<QObject*> as a model in QML.
@@ -325,7 +335,7 @@
*/
/*!
- \title Models and Views: Package
+ \title Models and Views: Package Example
\example declarative/modelviews/package
This example shows how to use the \l Package element.
@@ -334,7 +344,7 @@
*/
/*!
- \title Models and Views: Parallax
+ \title Models and Views: Parallax Example
\example declarative/modelviews/parallax
This example shows how to combine and switch between views.
@@ -343,7 +353,7 @@
*/
/*!
- \title Models and Views: String ListModel
+ \title Models and Views: String ListModel Example
\example declarative/modelviews/stringlistmodel
This example shows how to use a QStringList as a model in QML.
@@ -352,7 +362,7 @@
*/
/*!
- \title Models and Views: VisualItemModel
+ \title Models and Views: VisualItemModel Example
\example declarative/modelviews/visualitemmodel
This example shows how to use the VisualItemModel element.
@@ -361,7 +371,7 @@
*/
/*!
- \title Models and Views: WebView
+ \title Models and Views: WebView Example
\example declarative/modelviews/webview
These examples shows how to use the WebView element.
@@ -402,15 +412,23 @@
\endtable
*/
+
+/*!
+ \title Screen orientation
+ \example declarative/screenorientation
+
+ This example shows how to implement screen orientation support for your application.
+*/
+
/*!
- \title SQL Local Storage
+ \title SQL Local Storage Example
\example declarative/sqllocalstorage
This example shows how to use the SQL Local Storage API in QML.
*/
/*!
- \title Text: Fonts
+ \title Text: Fonts Example
\example declarative/text/fonts
These examples show how to discover available fonts from QML and manipulate
@@ -446,7 +464,7 @@
*/
/*!
- \title Text: Text Selection
+ \title Text: Text Selection Example
\example declarative/text/textselection
This example shows how text selection, copy and paste operations
@@ -456,7 +474,7 @@
*/
/*!
- \title Threading: Threaded ListModel
+ \title Threading: Threaded ListModel Example
\example declarative/threading/threadedlistmodel
This example shows how to use a ListModel from multiple threads using
@@ -464,14 +482,14 @@
*/
/*!
- \title Threading: WorkerScript
+ \title Threading: WorkerScript Example
\example declarative/threading/workerscript
This example shows how to use the WorkerScript element for threading in QML.
*/
/*!
- \title Toys: Clocks
+ \title Toys: Clocks Example
\example declarative/toys/clocks
This example displays a set of clocks with different times for different cities.
@@ -482,7 +500,7 @@
*/
/*!
- \title Toys: Corkboards
+ \title Toys: Corkboards Example
\example declarative/toys/corkboards
This example presents a flickable set of interactive corkboards. It is created
@@ -493,7 +511,7 @@
*/
/*!
- \title Toys: Dynamic Scene
+ \title Toys: Dynamic Scene Example
\example declarative/toys/dynamicscene
This example presents an interactive drag-and-drop scene. It demonstrates
@@ -504,7 +522,7 @@
*/
/*!
- \title Toys: Tic-Tac-Toe
+ \title Toys: Tic-Tac-Toe Example
\example declarative/toys/tic-tac-toe
This example presents a simple implementation of Tic Tac Toe.
@@ -513,7 +531,7 @@
*/
/*!
- \title Toys: TV Tennis
+ \title Toys: TV Tennis Example
\example declarative/toys/tvtennis
This example shows how to use animation components such as \l SpringAnimation,
@@ -523,14 +541,14 @@
*/
/*!
- \title Touch Interaction: Gestures
+ \title Touch Interaction: Gestures Example
\example declarative/touchinteraction/gestures
This example shows how to use the GestureArea element.
*/
/*!
- \title Touch Interaction: MouseArea
+ \title Touch Interaction: MouseArea Example
\example declarative/touchinteraction/mousearea
This example shows how to use the MouseArea element to access information
@@ -540,7 +558,7 @@
*/
/*!
- \title UI Components: Dial
+ \title UI Components: Dial Control Example
\example declarative/ui-components/dialcontrol
This example shows how to create a dial-type control. It combines
@@ -552,7 +570,7 @@
/*!
- \title UI Components: Flipable
+ \title UI Components: Flipable Example
\example declarative/ui-components/flipable
This example shows how to use the \l Flipable element.
@@ -561,7 +579,7 @@
*/
/*!
- \title UI Components: Progress Bars
+ \title UI Components: Progress Bars Example
\example declarative/ui-components/progressbar
This example shows how to create a progress bar.
@@ -570,7 +588,7 @@
*/
/*!
- \title UI Components: Scroll Bar
+ \title UI Components: Scroll Bar Example
\example declarative/ui-components/scrollbar
This example shows how to create scroll bars for a \l Flickable element
@@ -581,7 +599,7 @@
*/
/*!
- \title UI Components: Search Box
+ \title UI Components: Search Box Example
\example declarative/ui-components/searchbox
This example shows how to combine TextInput, FocusScope and BorderImage
@@ -591,7 +609,7 @@
*/
/*!
- \title UI Components: Slide Switch
+ \title UI Components: Slide Switch Example
\example declarative/ui-components/slideswitch
This example shows how to create a slide switch control.
@@ -600,7 +618,7 @@
*/
/*!
- \title UI Components: Spinner
+ \title UI Components: Spinner Example
\example declarative/ui-components/spinner
This example shows how to create a spinner-type component using the PathView element.
@@ -609,7 +627,7 @@
*/
/*!
- \title UI Components: Tab Widget
+ \title UI Components: Tab Widget Example
\example declarative/ui-components/tabwidget
This example shows how to create a tab widget. It also demonstrates how
@@ -620,7 +638,7 @@
*/
/*!
- \title XML: XMLHttpRequest
+ \title XML: XMLHttpRequest Example
\example declarative/xml/xmlhttprequest
This example shows how to use the \l XmlHttpRequest API in QML.
diff --git a/doc/src/examples/multitouch-dials.qdoc b/doc/src/examples/touch-dials.qdoc
index 632c4f6..552d752 100644
--- a/doc/src/examples/multitouch-dials.qdoc
+++ b/doc/src/examples/touch-dials.qdoc
@@ -26,11 +26,11 @@
****************************************************************************/
/*!
- \example multitouch/dials
- \title Multi-Touch Dials Example
+ \example touch/dials
+ \title Touch Dials Example
- The Multi-Touch Dials example shows how to apply multi-touch to a set of
+ The Touch Dials example shows how to apply touch to a set of
standard Qt widgets.
- \image multitouch-dials-example.png
+ \image touch-dials-example.png
*/
diff --git a/doc/src/examples/multitouch-knobs.qdoc b/doc/src/examples/touch-knobs.qdoc
index 14ee597..deb4c28 100644
--- a/doc/src/examples/multitouch-knobs.qdoc
+++ b/doc/src/examples/touch-knobs.qdoc
@@ -26,11 +26,11 @@
****************************************************************************/
/*!
- \example multitouch/knobs
- \title Multi-Touch Knobs Example
+ \example touch/knobs
+ \title Touch Knobs Example
- The Multi-Touch Knobs example shows how to create custom controls that
- accept multi-touch input.
+ The Touch Knobs example shows how to create custom controls that
+ accept touch input.
- \image multitouch-knobs-example.png
+ \image touch-knobs-example.png
*/
diff --git a/doc/src/files-and-resources/resources.qdoc b/doc/src/files-and-resources/resources.qdoc
index b0b0e3c..3177af8 100644
--- a/doc/src/files-and-resources/resources.qdoc
+++ b/doc/src/files-and-resources/resources.qdoc
@@ -54,7 +54,7 @@
The resource system is based on tight cooperation between \l qmake,
\l rcc (Qt's resource compiler), and QFile. It obsoletes Qt 3's
\c qembed tool and the
- \l{http://qt.nokia.com/doc/qq/qq05-iconography.html#imagestorage}{image
+ \l{http://doc.qt.nokia.com/qq/qq05-iconography.html}{image
collection} mechanism.
\section1 Resource Collection Files (\c{.qrc})
diff --git a/doc/src/frameworks-technologies/eventsandfilters.qdoc b/doc/src/frameworks-technologies/eventsandfilters.qdoc
index e792161..fb14a3b 100644
--- a/doc/src/frameworks-technologies/eventsandfilters.qdoc
+++ b/doc/src/frameworks-technologies/eventsandfilters.qdoc
@@ -100,7 +100,7 @@
event delivery mechanisms are flexible. The documentation for
QCoreApplication::notify() concisely tells the whole story; the
\e{Qt Quarterly} article
- \l{http://qt.nokia.com/doc/qq/qq11-events.html}{Another Look at Events}
+ \l{http://doc.qt.nokia.com/qq/qq11-events.html}{Another Look at Events}
rehashes it less concisely. Here we will explain enough for 95%
of applications.
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index a32d120..b2895ba 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -837,19 +837,19 @@
*/
/*!
- \page examples-multitouch.html
+ \page examples-touch.html
\ingroup all-examples
- \title Multi-Touch Examples
- \brief Using Qt's multi-touch input capability
+ \title Touch Input Examples
+ \brief Using Qt's touch input capability
- Support for multi-touch input makes it possible for developers to create
+ Support for touch input makes it possible for developers to create
extensible and intuitive user interfaces.
\list
- \o \l{multitouch/dials}{Multi-Touch Dials}
- \o \l{multitouch/fingerpaint}{Finger Paint}
- \o \l{multitouch/knobs}{Multi-Touch Knobs}
- \o \l{multitouch/pinchzoom}{Pinch Zoom}
+ \o \l{touch/dials}{Touch Dials}
+ \o \l{touch/fingerpaint}{Finger Paint}
+ \o \l{touch/knobs}{Touch Knobs}
+ \o \l{touch/pinchzoom}{Pinch Zoom}
\endlist
*/
diff --git a/doc/src/getting-started/gettingstarted.qdoc b/doc/src/getting-started/gettingstarted.qdoc
new file mode 100644
index 0000000..9b6b5d5
--- /dev/null
+++ b/doc/src/getting-started/gettingstarted.qdoc
@@ -0,0 +1,516 @@
+/****************************************************************************
+**
+** 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:FDL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in a
+** written agreement between you and Nokia.
+**
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page gettingstarted.html
+
+ \title Getting Started
+
+ Welcome to the world of Qt--the cross-platform GUI toolkit. In
+ this getting started guide, we teach basic Qt knowledge by
+ implementing a simple Notepad application. After reading this
+ guide, you should be ready to delve into our overviews and API
+ documentation, and find the information you need for the
+ application you are developing.
+
+ \section1 Hello Notepad
+
+ In this first example, we simply create and show a text edit in a
+ window frame on the desktop. This represents the simplest possible
+ Qt program that has a GUI.
+
+ \image gs1.png
+
+ Here is the code:
+
+ \code
+ 1 #include <QApplication>
+ 2 #include <QTextEdit>
+ 3
+ 4 int main(int argv, char **args)
+ 5 {
+ 6 QApplication app(argv, args);
+ 7
+ 8 QTextEdit textEdit;
+ 9 textEdit.show();
+10
+11 return app.exec();
+12 }
+ \endcode
+
+ Let us go through the code line by line. In the first two lines, we
+ include the header files for QApplication and QTextEdit, which are
+ the two classes that we need for this example. All Qt classes have
+ a header file named after them.
+
+ Line 6 creates a QApplication object. This object manages
+ application-wide resources and is necessary to run any Qt program
+ that has a GUI. It needs \c argv and \c args because Qt accepts a
+ few command line arguments.
+
+ Line 8 creates a QTextEdit object. A text edit is a visual element
+ in the GUI. In Qt, we call such elements widgets. Examples of
+ other widgets are scroll bars, labels, and radio buttons. A widget
+ can also be a container for other widgets; a dialog or a main
+ application window, for example.
+
+ Line 9 shows the text edit on the screen in its own window frame.
+ Since widgets also function as containers (for instance a
+ QMainWindow, which has toolbars, menus, a status bar, and a few
+ other widgets), it is possible to show a single widget in its own
+ window. Widgets are not visible by default; the function
+ \l{QWidget::}{show()} makes the widget visible.
+
+ Line 11 makes the QApplication enter its event loop. When a Qt
+ application is running, events are generated and sent to the
+ widgets of the application. Examples of events are mouse presses
+ and key strokes. When you type text in the text edit widget, it
+ receives key pressed events and responds by drawing the text
+ typed.
+
+ To run the application, open a command prompt, and enter the
+ directory in which you have the \c .cpp file of the program. The
+ following shell commands build the program.
+
+ \code
+ qmake -project
+ qmake
+ make
+ \endcode
+
+ This will leave an executable in the \c part1 directory (note that
+ on Windows, you may have to use \c nmake instead of \c make. Also,
+ the executable will be placed in part1/debug or part1/release). \c
+ qmake is Qt's build tool, which takes a configuration file. \c
+ qmake generates this for us when given the \c{-project} argument.
+ Given the configuration file (suffixed .pro), \c qmake produces a
+ \c make file that will build the program for you. We will look
+ into writing our own \c .pro files later.
+
+ \section2 Learn More
+
+ \table
+ \header
+ \o About
+ \o Here
+ \row
+ \o Widgets and Window Geometry
+ \o \l{Window and Dialog Widgets}
+ \row
+ \o Events and event handling
+ \o \l{The Event System}
+ \endtable
+
+ \section1 Adding a Quit Button
+
+ In a real application, you will normally need more than one
+ widget. We will now introduce a QPushButton beneath the text edit.
+ The button will exit the Notepad application when pushed (i.e.,
+ clicked on with the mouse).
+
+ \image gs2.png
+
+ Let us take a look at the code.
+
+ \code
+ 1 #include <QtGui>
+ 2
+ 3 int main(int argv, char **args)
+ 4 {
+ 5 QApplication app(argv, args);
+ 6
+ 7 QTextEdit textEdit;
+ 8 QPushButton quitButton("Quit");
+ 9
+10 QObject::connect(&quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
+11
+12 QVBoxLayout layout;
+13 layout.addWidget(&textEdit);
+14 layout.addWidget(&quitButton);
+15
+16 QWidget window;
+17 window.setLayout(&layout);
+18
+19 window.show();
+20
+21 return app.exec();
+22 }
+ \endcode
+
+ Line 1 includes QtGui, which contains all of Qt's GUI classes.
+
+ Line 10 uses Qt's Signals and Slots mechanism to make the
+ application exit when the \gui {Quit button} is pushed. A slot is
+ a function that can be invoked at runtime using its name (as a
+ literal string). A signal is a function that when called will
+ invoke slots registered with it; we call that to connect the slot
+ to the signal and to emit the signal.
+
+ \l{QApplication::}{quit()} is a slot of QApplication that exits
+ the application. \l{QPushButton::}{clicked()} is a signal that
+ QPushButton emits when it is pushed. The static
+ QObject::connect() function takes care of connecting the slot to
+ the signal. SIGNAL() and SLOT() are two macros that take the
+ function signatures of the signal and slot to connect. We also
+ need to give pointers to the objects that should send and receive
+ the signal.
+
+ Line 12 creates a QVBoxLayout. As mentioned, widgets can contain
+ other widgets. It is possible to set the bounds (the location and
+ size) of child widgets directly, but it is usually easier to use a
+ layout. A layout manages the bounds of a widget's children.
+ QVBoxLayout, for instance, places the children in a vertical row.
+
+ Line 13 and 14 adds the text edit and button to the layout. In
+ line 17, we set the layout on a widget.
+
+ \section2 Learn More
+
+ \table
+ \header
+ \o About
+ \o Here
+ \row
+ \o Signals and slots
+ \o \l{Signals & Slots}
+ \row
+ \o Layouts
+ \o \l{Layout Management},
+ \l{Widgets and Layouts},
+ \l{Layout Examples}
+ \row
+ \o The widgets that come with Qt
+ \o \l{Qt Widget Gallery},
+ \l{Widget Examples}
+ \endtable
+
+ \section1 Subclassing QWidget
+
+ When the user wants to quit an application, you might want to
+ pop-up a dialog that asks whether he/she really wants to quit. In
+ this example, we subclass QWidget, and add a slot that we connect
+ to the \gui {Quit button}.
+
+ \image gs3.png
+
+ Let us look at the code:
+
+ \code
+ 5 class Notepad : public QWidget
+ 6 {
+ 7 Q_OBJECT
+ 8
+ 9 public:
+10 Notepad();
+11
+12 private slots:
+13 void quit();
+14
+15 private:
+16 QTextEdit *textEdit;
+17 QPushButton *quitButton;
+18 };
+ \endcode
+
+ The \c Q_OBJECT macro must be first in the class definition, and
+ declares our class as a \c QObject (Naturally, it must also
+ inherit from QObject). A \l{QObject} adds several abilities to a
+ normal C++ class. Notably, the class name and slot names can be
+ queried at run-time. It is also possible to query a slot's
+ parameter types and invoke it.
+
+ Line 13 declares the slot \c quit(). This is easy using the \c
+ slots macro. The \c quit() slot can now be connected to signals
+ with a matching signature (any signal that takes no parameters).
+
+ Instead of setting up the GUI and connecting the slot in the \c
+ main() function, we now use \c{Notepad}'s constructor.
+
+ \code
+ Notepad::Notepad()
+ {
+ textEdit = new QTextEdit;
+ quitButton = new QPushButton(tr("Quit"));
+
+ connect(quitButton, SIGNAL(clicked()), this, SLOT(quit()));
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(textEdit);
+ layout->addWidget(quitButton);
+
+ setLayout(layout);
+
+ setWindowTitle(tr("Notepad"));
+ }
+ \endcode
+
+ As you saw in the class definition, we use pointers to our \l
+ {QObject}s (\c textEdit and \c quitButton). As a rule, you should
+ always allocate \l{QObject}s on the heap and never copy them.
+
+ We now use the function \l{QObject::}{tr()} around our user
+ visible strings. This function is necessary when you want to
+ provide your application in more than one language (e.g. English
+ and Chinese). We will not go into details here, but you can follow
+ the \c {Qt Linguist} link from the learn more table.
+
+ \section2 Learn More
+
+ \table
+ \header
+ \o About
+ \o Here
+ \row
+ \o tr() and internationalization
+ \o \l{Qt Linguist Manual},
+ \l{Writing Source Code for Translation},
+ \l{Hello tr() Example},
+ \l{Internationalization with Qt}
+ \row
+ \o QObjects and the Qt Object model (This is essential to understand Qt)
+ \o \l{Object Model}
+ \row
+ \o qmake and the Qt build system
+ \o \l{qmake Manual}
+ \endtable
+
+ \section2 Creating a .pro file
+
+ For this example, we write our own \c .pro file instead of
+ using \c qmake's \c -project option.
+
+ \code
+ HEADERS = notepad.h
+ SOURCES = notepad.cpp \
+ main.cpp
+ \endcode
+
+ The following shell commands build the example.
+
+ \code
+ qmake
+ make
+ \endcode
+
+ \section1 Using a QMainWindow
+
+ Many applications will benefit from using a QMainWindow, which has
+ its own layout to which you can add a menu bar, dock widgets, tool
+ bars, and a status bar. QMainWindow has a center area that can be
+ occupied by any kind of widget. In our case, we will place our
+ text edit there.
+
+ \image gs4.png
+
+ Let us look at the new \c Notepad class definition.
+
+ \code
+ #include <QtGui>
+
+ class Notepad : public QMainWindow
+ {
+ Q_OBJECT
+
+ public:
+ Notepad();
+
+ private slots:
+ void open();
+ void save();
+ void quit();
+
+ private:
+ QTextEdit *textEdit;
+
+ QAction *openAction;
+ QAction *saveAction;
+ QAction *exitAction;
+
+ QMenu *fileMenu;
+ };
+ \endcode
+
+ We include two more slots that can save and open a document. We
+ will implement these in the next section.
+
+ Often, in a main window, the same slot should be invoked by
+ several widgets. Examples are menu items and buttons on a tool
+ bar. To make this easier, Qt provides QAction, which can be given
+ to several widgets, and be connected to a slot. For instance, both
+ QMenu and QToolBar can create menu items and tool buttons from the
+ same \l{QAction}s. We will see how this works shortly.
+
+ As before, we use the \c {Notepad}s constructor to set up the
+ GUI.
+
+ \code
+ Notepad::Notepad()
+ {
+ saveAction = new QAction(tr("&Open"), this);
+ saveAction = new QAction(tr("&Save"), this);
+ exitAction = new QAction(tr("E&xit"), this);
+
+ connect(openAction, SIGNAL(triggered()), this, SLOT(open()));
+ connect(saveAction, SIGNAL(triggered()), this, SLOT(save()));
+ connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ fileMenu->addAction(openAction);
+ fileMenu->addAction(saveAction);
+ fileMenu->addSeparator();
+ fileMenu->addAction(exitAction);
+
+ textEdit = new QTextEdit;
+ setCentralWidget(textEdit);
+
+ setWindowTitle(tr("Notepad"));
+ }
+ \endcode
+
+ \l{QAction}s are created with the text that should appear on the
+ widgets that we add them to (in our case, menu items). If we also
+ wanted to add them to a tool bar, we could have given
+ \l{QIcon}{icons} to the actions.
+
+ When a menu item is clicked now, the item will trigger the action,
+ and the respective slot will be invoked.
+
+ \section2 Learn More
+
+ \table
+ \header
+ \o About
+ \o Here
+ \row
+ \o Main windows and main window classes
+ \o \l{Application Main Window},
+ \l{Main Window Examples}
+ \row
+ \o MDI applications
+ \o QMdiArea,
+ \l{MDI Example}
+ \endtable
+
+ \section1 Saving and Loading
+
+ In this example, we will implement the functionality of the \c
+ open() and \c save() slots that we added in the previous example.
+
+ \image gs5.png
+
+ We will start with the \c open() slot:
+
+ \code
+ QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
+ tr("Text Files (*.txt);;C++ Files (*.cpp *.h)"));
+
+ if (fileName != "") {
+ QFile file(fileName);
+ if (!file.open(QIODevice::ReadOnly)) {
+ QMessageBox::critical(this, tr("Error"),
+ tr("Could not open file"));
+ return;
+ }
+ QString contents = file.readAll().constData();
+ textEdit->setPlainText(contents);
+ file.close();
+ }
+ \endcode
+
+ The first step is asking the user for the name of the file to
+ open. Qt comes with QFileDialog, which is a dialog from which the
+ user can select a file. The image above shows the dialog on
+ Kubuntu. The static \l{QFileDialog::}{getOpenFileName()} function
+ displays a modal file dialog, and does not return until the user
+ has selected a file. It returns the file path of the file
+ selected, or an empty string if the user canceled the dialog.
+
+ If we have a file name, we try to open the file with
+ \l{QIODevice::}{open()}, which returns true if the file could be
+ opened. We will not go into error handling here, but you can follow
+ the links from the learn more section. If the file could not be
+ opened, we use QMessageBox to display a dialog with an error
+ message (see the QMessageBox class description for further
+ details).
+
+ Actually reading in the data is trivial using the
+ \l{QIODevice::}{readAll()} function, which returns all data in the
+ file in a QByteArray. The \l{QByteArray::}{constData()} returns all
+ data in the array as a const char*, which QString has a
+ constructor for. The contents can then be displayed in the text
+ edit. We then \l{QIODevice::}{close()} the file to return the file
+ descriptor back to the operating system.
+
+ Now, let us move on to the the \c save() slot.
+
+ \code
+ QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "",
+ tr("Text Files (*.txt);;C++ Files (*.cpp *.h)"));
+
+ if (fileName != "") {
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly)) {
+ // error message
+ } else {
+ QTextStream stream(&file);
+ stream << textEdit->toPlainText();
+ stream.flush();
+ file.close();
+ }
+ }
+ \endcode
+
+ When we write the contents of the text edit to the file, we use
+ the QTextStream class, which wraps the QFile object. The text
+ stream can write QStrings directly to the file; QFile only accepts
+ raw data (char*) with the \l{QIODevice::}{write()} functions of
+ QIODevice.
+
+ \section2 Learn More
+
+ \table
+ \header
+ \o About
+ \o Here
+ \row
+ \o Files and I/O devices
+ \o QFile, QIODevice
+ \endtable
+
+ \omit
+ \section1 Moving On
+
+ This may not be true for the first release.
+ The Qt documentation comes with three getting started guides. You
+ have come to the end of the first, which concerns itself with
+ basic Qt concepts. We also have guides covering intermediate and
+ advanced topics. They are found here: You may also have noticed that the learn more sections in
+ this guide frequently linked to them.
+ Basic Qt Architecture
+ \endomit
+*/
+
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index 90723ec..629d8b7 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -30,10 +30,13 @@
\title Installation
\brief Installing Qt on supported platforms.
-The installation procedure is different on each Qt platform.
-Please follow the instructions for your platform from the following list.
+The installation procedure is different on each Qt platform. This page provides
+information on how to install Qt, as well as software and hardware requirements
+for using Qt on each of the supported platforms. Please follow the instructions
+for your platform from the following list.
\generatelist{related}
+
*/
/*! \page install-x11.html
diff --git a/doc/src/getting-started/tutorials.qdoc b/doc/src/getting-started/tutorials.qdoc
index 6e1cee8..46a5808 100644
--- a/doc/src/getting-started/tutorials.qdoc
+++ b/doc/src/getting-started/tutorials.qdoc
@@ -71,6 +71,30 @@
A guided tour through the translations process, explaining the
tools provided for developers, translators and release managers.
+
+ \row
+ \o{2,1} \l{modelview.html}{\bold{ModelView}}
+ \o{2,1}
+
+ \row
+ \o \image treeview_sml.png ModelView
+ \o This tutorial gives an introduction to ModelView programming using the Qt cross-platform framework
+
+ \o
+ \o
+
+ \row
+ \o{2,1} \l{QML Tutorial}{\bold QML Tutorial}
+ \o{2,1} \l{QML Advanced Tutorial}{\bold SameGame}
+ \row
+ \o{2,1}
+ This tutorial provides a very basic introduction to QML.
+ \o \image qml-samegame-demo-small.png Samegame
+ \o
+ This tutorial walks through creating a complete application with QML,
+ in this case a simple game. It is recommended that you complete the basic QML
+ tutorial first.
+
\row
\o{2,1} \l{QTestLib Tutorial}{\bold QTestLib}
\o{2,1} \l{qmake Tutorial}{\bold qmake}
diff --git a/doc/src/images/addressbook-tutorial-part1-labeled-layout.png b/doc/src/images/addressbook-tutorial-part1-labeled-layout.png
index ef514c8..b19cb36 100644
--- a/doc/src/images/addressbook-tutorial-part1-labeled-layout.png
+++ b/doc/src/images/addressbook-tutorial-part1-labeled-layout.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part1-labeled-screenshot.png b/doc/src/images/addressbook-tutorial-part1-labeled-screenshot.png
index 4381079..f9b91ee 100644
--- a/doc/src/images/addressbook-tutorial-part1-labeled-screenshot.png
+++ b/doc/src/images/addressbook-tutorial-part1-labeled-screenshot.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part1-screenshot.png b/doc/src/images/addressbook-tutorial-part1-screenshot.png
index cf15627..454b095 100644
--- a/doc/src/images/addressbook-tutorial-part1-screenshot.png
+++ b/doc/src/images/addressbook-tutorial-part1-screenshot.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part2-add-contact.png b/doc/src/images/addressbook-tutorial-part2-add-contact.png
index 330858d..6f2b947 100644
--- a/doc/src/images/addressbook-tutorial-part2-add-contact.png
+++ b/doc/src/images/addressbook-tutorial-part2-add-contact.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part2-add-successful.png b/doc/src/images/addressbook-tutorial-part2-add-successful.png
index 3b108fb..99a2154 100644
--- a/doc/src/images/addressbook-tutorial-part2-add-successful.png
+++ b/doc/src/images/addressbook-tutorial-part2-add-successful.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part2-labeled-layout.png b/doc/src/images/addressbook-tutorial-part2-labeled-layout.png
index 73f6dfb..1e000c8 100644
--- a/doc/src/images/addressbook-tutorial-part2-labeled-layout.png
+++ b/doc/src/images/addressbook-tutorial-part2-labeled-layout.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part3-labeled-layout.png b/doc/src/images/addressbook-tutorial-part3-labeled-layout.png
index 662fa7f..1981ba8 100644
--- a/doc/src/images/addressbook-tutorial-part3-labeled-layout.png
+++ b/doc/src/images/addressbook-tutorial-part3-labeled-layout.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part3-screenshot.png b/doc/src/images/addressbook-tutorial-part3-screenshot.png
index 97d1357..75159b4 100644
--- a/doc/src/images/addressbook-tutorial-part3-screenshot.png
+++ b/doc/src/images/addressbook-tutorial-part3-screenshot.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part4-remove.png b/doc/src/images/addressbook-tutorial-part4-remove.png
index 42b0f92..8eb259e 100644
--- a/doc/src/images/addressbook-tutorial-part4-remove.png
+++ b/doc/src/images/addressbook-tutorial-part4-remove.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part5-finddialog.png b/doc/src/images/addressbook-tutorial-part5-finddialog.png
index 18e5451..743d92e 100644
--- a/doc/src/images/addressbook-tutorial-part5-finddialog.png
+++ b/doc/src/images/addressbook-tutorial-part5-finddialog.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part5-notfound.png b/doc/src/images/addressbook-tutorial-part5-notfound.png
index be7172e..2d35766 100644
--- a/doc/src/images/addressbook-tutorial-part5-notfound.png
+++ b/doc/src/images/addressbook-tutorial-part5-notfound.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part5-screenshot.png b/doc/src/images/addressbook-tutorial-part5-screenshot.png
index ea4a66c..3abe277 100644
--- a/doc/src/images/addressbook-tutorial-part5-screenshot.png
+++ b/doc/src/images/addressbook-tutorial-part5-screenshot.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part6-load.png b/doc/src/images/addressbook-tutorial-part6-load.png
index 95fdcaf..a027a1d 100644
--- a/doc/src/images/addressbook-tutorial-part6-load.png
+++ b/doc/src/images/addressbook-tutorial-part6-load.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part6-save.png b/doc/src/images/addressbook-tutorial-part6-save.png
index c0deb70..757feeb 100644
--- a/doc/src/images/addressbook-tutorial-part6-save.png
+++ b/doc/src/images/addressbook-tutorial-part6-save.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part6-screenshot.png b/doc/src/images/addressbook-tutorial-part6-screenshot.png
index f77bf03..7bb2f74 100644
--- a/doc/src/images/addressbook-tutorial-part6-screenshot.png
+++ b/doc/src/images/addressbook-tutorial-part6-screenshot.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-part7-screenshot.png b/doc/src/images/addressbook-tutorial-part7-screenshot.png
index d6b0a50..3e7b3ca 100644
--- a/doc/src/images/addressbook-tutorial-part7-screenshot.png
+++ b/doc/src/images/addressbook-tutorial-part7-screenshot.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial-screenshot.png b/doc/src/images/addressbook-tutorial-screenshot.png
index d6727dc..3fba6e8 100644
--- a/doc/src/images/addressbook-tutorial-screenshot.png
+++ b/doc/src/images/addressbook-tutorial-screenshot.png
Binary files differ
diff --git a/doc/src/images/addressbook-tutorial.png b/doc/src/images/addressbook-tutorial.png
index 495edda..f80b42d 100644
--- a/doc/src/images/addressbook-tutorial.png
+++ b/doc/src/images/addressbook-tutorial.png
Binary files differ
diff --git a/doc/src/images/clock.png b/doc/src/images/clock.png
new file mode 100755
index 0000000..c7f6a1b
--- /dev/null
+++ b/doc/src/images/clock.png
Binary files differ
diff --git a/doc/src/images/columnview.png b/doc/src/images/columnview.png
new file mode 100644
index 0000000..127b795
--- /dev/null
+++ b/doc/src/images/columnview.png
Binary files differ
diff --git a/doc/src/images/combobox.png b/doc/src/images/combobox.png
new file mode 100755
index 0000000..d172b41
--- /dev/null
+++ b/doc/src/images/combobox.png
Binary files differ
diff --git a/doc/src/images/dummy_tree.png b/doc/src/images/dummy_tree.png
new file mode 100755
index 0000000..7373ea6
--- /dev/null
+++ b/doc/src/images/dummy_tree.png
Binary files differ
diff --git a/doc/src/images/edit.png b/doc/src/images/edit.png
new file mode 100755
index 0000000..161b06f
--- /dev/null
+++ b/doc/src/images/edit.png
Binary files differ
diff --git a/doc/src/images/example_model.png b/doc/src/images/example_model.png
new file mode 100755
index 0000000..4261261
--- /dev/null
+++ b/doc/src/images/example_model.png
Binary files differ
diff --git a/doc/src/images/gs1.png b/doc/src/images/gs1.png
new file mode 100644
index 0000000..875dd39
--- /dev/null
+++ b/doc/src/images/gs1.png
Binary files differ
diff --git a/doc/src/images/gs2.png b/doc/src/images/gs2.png
new file mode 100644
index 0000000..aaba3b2
--- /dev/null
+++ b/doc/src/images/gs2.png
Binary files differ
diff --git a/doc/src/images/gs3.png b/doc/src/images/gs3.png
new file mode 100644
index 0000000..5e474e3
--- /dev/null
+++ b/doc/src/images/gs3.png
Binary files differ
diff --git a/doc/src/images/gs4.png b/doc/src/images/gs4.png
new file mode 100644
index 0000000..7a8237e
--- /dev/null
+++ b/doc/src/images/gs4.png
Binary files differ
diff --git a/doc/src/images/gs5.png b/doc/src/images/gs5.png
new file mode 100644
index 0000000..b3cab60
--- /dev/null
+++ b/doc/src/images/gs5.png
Binary files differ
diff --git a/doc/src/images/header.png b/doc/src/images/header.png
new file mode 100755
index 0000000..2597635
--- /dev/null
+++ b/doc/src/images/header.png
Binary files differ
diff --git a/doc/src/images/lineedit.png b/doc/src/images/lineedit.png
new file mode 100755
index 0000000..83d1c47
--- /dev/null
+++ b/doc/src/images/lineedit.png
Binary files differ
diff --git a/doc/src/images/list_table_tree.png b/doc/src/images/list_table_tree.png
new file mode 100755
index 0000000..b2daf1f
--- /dev/null
+++ b/doc/src/images/list_table_tree.png
Binary files differ
diff --git a/doc/src/images/listview.png b/doc/src/images/listview.png
new file mode 100755
index 0000000..fa49c52
--- /dev/null
+++ b/doc/src/images/listview.png
Binary files differ
diff --git a/doc/src/images/lotto.png b/doc/src/images/lotto.png
new file mode 100755
index 0000000..dd751cf
--- /dev/null
+++ b/doc/src/images/lotto.png
Binary files differ
diff --git a/doc/src/images/modelview.png b/doc/src/images/modelview.png
new file mode 100755
index 0000000..7b042af
--- /dev/null
+++ b/doc/src/images/modelview.png
Binary files differ
diff --git a/doc/src/images/path.png b/doc/src/images/path.png
new file mode 100755
index 0000000..73107ff
--- /dev/null
+++ b/doc/src/images/path.png
Binary files differ
diff --git a/doc/src/images/qcompleter.png b/doc/src/images/qcompleter.png
new file mode 100755
index 0000000..d25caac
--- /dev/null
+++ b/doc/src/images/qcompleter.png
Binary files differ
diff --git a/doc/src/images/qml-pathview-example.png b/doc/src/images/qml-pathview-example.png
new file mode 100644
index 0000000..c874c5c
--- /dev/null
+++ b/doc/src/images/qml-pathview-example.png
Binary files differ
diff --git a/doc/src/images/readonlytable.png b/doc/src/images/readonlytable.png
new file mode 100755
index 0000000..90bcba4
--- /dev/null
+++ b/doc/src/images/readonlytable.png
Binary files differ
diff --git a/doc/src/images/readonlytable_role.png b/doc/src/images/readonlytable_role.png
new file mode 100755
index 0000000..7d2d416
--- /dev/null
+++ b/doc/src/images/readonlytable_role.png
Binary files differ
diff --git a/doc/src/images/selection2.png b/doc/src/images/selection2.png
new file mode 100755
index 0000000..66c757f
--- /dev/null
+++ b/doc/src/images/selection2.png
Binary files differ
diff --git a/doc/src/images/standardwidget.png b/doc/src/images/standardwidget.png
new file mode 100755
index 0000000..3ccccf1
--- /dev/null
+++ b/doc/src/images/standardwidget.png
Binary files differ
diff --git a/doc/src/images/tableview.png b/doc/src/images/tableview.png
new file mode 100755
index 0000000..8be1b6c
--- /dev/null
+++ b/doc/src/images/tableview.png
Binary files differ
diff --git a/doc/src/images/multitouch-dials-example.png b/doc/src/images/touch-dials-example.png
index 60e1776..60e1776 100644
--- a/doc/src/images/multitouch-dials-example.png
+++ b/doc/src/images/touch-dials-example.png
Binary files differ
diff --git a/doc/src/images/multitouch-examples.png b/doc/src/images/touch-examples.png
index b053cf3..b053cf3 100644
--- a/doc/src/images/multitouch-examples.png
+++ b/doc/src/images/touch-examples.png
Binary files differ
diff --git a/doc/src/images/multitouch-fingerpaint-example.png b/doc/src/images/touch-fingerpaint-example.png
index c741b65..c741b65 100644
--- a/doc/src/images/multitouch-fingerpaint-example.png
+++ b/doc/src/images/touch-fingerpaint-example.png
Binary files differ
diff --git a/doc/src/images/multitouch-knobs-example.png b/doc/src/images/touch-knobs-example.png
index 1cbd90d..1cbd90d 100644
--- a/doc/src/images/multitouch-knobs-example.png
+++ b/doc/src/images/touch-knobs-example.png
Binary files differ
diff --git a/doc/src/images/multitouch-pinchzoom-example.png b/doc/src/images/touch-pinchzoom-example.png
index 1079fb2..1079fb2 100644
--- a/doc/src/images/multitouch-pinchzoom-example.png
+++ b/doc/src/images/touch-pinchzoom-example.png
Binary files differ
diff --git a/doc/src/images/tree.png b/doc/src/images/tree.png
new file mode 100755
index 0000000..3f046c9
--- /dev/null
+++ b/doc/src/images/tree.png
Binary files differ
diff --git a/doc/src/images/tree_2.png b/doc/src/images/tree_2.png
new file mode 100755
index 0000000..6ee1f4a
--- /dev/null
+++ b/doc/src/images/tree_2.png
Binary files differ
diff --git a/doc/src/images/tree_2_with_algorithm.png b/doc/src/images/tree_2_with_algorithm.png
new file mode 100755
index 0000000..ecf9101
--- /dev/null
+++ b/doc/src/images/tree_2_with_algorithm.png
Binary files differ
diff --git a/doc/src/images/tree_city.png b/doc/src/images/tree_city.png
new file mode 100755
index 0000000..57f03d9
--- /dev/null
+++ b/doc/src/images/tree_city.png
Binary files differ
diff --git a/doc/src/images/treeview.png b/doc/src/images/treeview.png
new file mode 100755
index 0000000..af31fe9
--- /dev/null
+++ b/doc/src/images/treeview.png
Binary files differ
diff --git a/doc/src/images/treeview_sml.png b/doc/src/images/treeview_sml.png
new file mode 100755
index 0000000..fb6de1d
--- /dev/null
+++ b/doc/src/images/treeview_sml.png
Binary files differ
diff --git a/doc/src/images/widgetmapper.png b/doc/src/images/widgetmapper.png
new file mode 100755
index 0000000..9627088
--- /dev/null
+++ b/doc/src/images/widgetmapper.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 92721c5..7efd1e6 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -40,8 +40,8 @@
</div>
<div class="section sectionlist">
<ul>
- <li><a href="">Getting started</a></li>
- <li><a href="installation.html">Installation &amp; first steps</a></li>
+ <li><a href="gettingstarted.html">Getting started</a></li>
+ <li><a href="installation.html">Installation</a></li>
<li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
<li><a href="tutorials.html">Tutorials</a></li>
<li><a href="all-examples.html">Examples</a></li>
@@ -56,29 +56,29 @@
<div class="indexboxcont indexboxbar ">
<div class="sectionlist tricol">
<ul>
- <li><a href="classes.html">Class index</a></li>
- <li><a href="functions.html">Function index</a></li>
- <li><a href="modules.html">Modules</a></li>
- <li><a href="namespaces.html">Namespaces</a></li>
- <li><a href="qtglobal.html">Global Declarations</a></li>
+ <li><a href="classes.html">Class index</a></li>
+ <li><a href="functions.html">Function index</a></li>
+ <li><a href="modules.html">Modules</a></li>
+ <li><a href="namespaces.html">Namespaces</a></li>
+ <li><a href="qtglobal.html">Global Declarations</a></li>
</ul>
</div>
<div class="sectionlist tricol">
<ul>
- <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
- <li><a href="qt-basic-concepts.html">Qt Architecture</a></li>
- <li><a href="developing-with-qt.html">Cross-platform &amp; Platform-specific Development</a></li>
- <li><a href="technology-apis.html">Qt &amp; standard technologies </a></li>
- <li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
+ <!-- <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> -->
+ <li><a href="qt-basic-concepts.html">Basic Qt Architecture</a></li>
+ <li><a href="developing-with-qt.html">Cross-platform &amp; Platform-specific Development</a></li>
+ <li><a href="technology-apis.html">Qt &amp; standard technologies </a></li>
+ <li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
</ul>
</div>
<div class="sectionlist">
<ul>
- <li><a href="declarativeui.html">Qt Quick</a></li>
- <li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
- <li><a href="qdeclarativeelements.html">QML Elements</a></li>
- <li><a href="qt-gui-concepts.html">UI components</a></li>
- <li><a href="declarativeui.html">Qt & GUI design</a></li>
+ <li><a href="declarativeui.html">Qt Quick</a></li>
+ <li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
+ <li><a href="qdeclarativeelements.html">QML Elements</a></li>
+ <li><a href="qt-gui-concepts.html">UI components</a></li>
+ <!-- <li><a href="declarativeui.html">Qt & GUI design</a></li> -->
</ul>
</div>
</div>
@@ -94,16 +94,17 @@
</div>
<div class="section sectionlist">
<ul>
- <li><a href="http://doc.qt.nokia.com/qtcreator-1.3/index.html">Qt Creator</a></li>
+ <li><a href="http://doc.qt.nokia.com/qtcreator-2.0/index.html">Qt Creator</a> (online document)</li>
<li><a href="designer-manual.html">Qt Designer</a></li>
<li><a href="linguist-manual.html">Qt Linguist</a></li>
<li><a href="assistant-manual.html">Qt Assistant</a></li>
- <li><a href="http://doc.qt.nokia.com/">Integration and add-ins</a></li>
+ <li><a href="http://doc.qt.nokia.com/qtsimulator-1.0/simulator-description.html">Qt Simulator</a> (online document)</li>
+ <li><a href="http://qt.nokia.com/developer/eclipse-integration">Integration</a> (online document) and <a href="http://qt.nokia.com/products/appdev">add-ins</a> (online document)</li>
<li><a href="qvfb.html">Virtual Framebuffer</a></li>
</ul>
</div>
</div>
- </div>
+ </div>
\endraw
*/
diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc
index c8d8e9d..fa992af 100644
--- a/doc/src/internationalization/linguist-manual.qdoc
+++ b/doc/src/internationalization/linguist-manual.qdoc
@@ -1414,8 +1414,8 @@
\c -pluralonly command line option, which allows the creation of
TS files containing only entries with plural forms.
- See the \l{http://qt.nokia.com/doc/qq/}{Qt Quarterly} Article
- \l{http://qt.nokia.com/doc/qq/qq19-plurals.html}{Plural Forms in Translations}
+ See the \l{http://doc.qt.nokia.com/qq/}{Qt Quarterly} Article
+ \l{http://doc.qt.nokia.com/qq/qq19-plurals.html}{Plural Forms in Translations}
for further details on this issue.
\section2 Coping With C++ Namespaces
diff --git a/doc/src/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc
index 110dac7..e7133e3 100644
--- a/doc/src/legal/3rdparty.qdoc
+++ b/doc/src/legal/3rdparty.qdoc
@@ -194,16 +194,16 @@
\hr
copyright (C) 1999 by Willem van Schaik <willem@schaik.com>
-
+
version 1.0 - 1999.10.15 - First version.
-
+
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear in
supporting documentation. This software is provided "as is" without
express or implied warranty.
-
+
\hr
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
@@ -293,7 +293,7 @@
Copyright (c) 1987, 1993, 1994\br
The Regents of the University of California. All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:\br
@@ -305,7 +305,7 @@
3. Neither the name of the University 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 REGENTS 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
@@ -336,7 +336,7 @@
Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>\br
Copyright (c( 1996 USAF Phillips Laboratory\br
Additions (c) Richard Nolde 2006-2009
-
+
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
@@ -344,11 +344,11 @@
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.
-
+
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
+
IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
@@ -360,11 +360,11 @@
Copyright (c) 1985, 1986 The Regents of the University of California.\br
All rights reserved.
-
+
This code is derived from software contributed to Berkeley by
James A. Woods, derived from original work by Spencer Thomas
and Joseph Orost.
-
+
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
@@ -381,7 +381,7 @@
Copyright (c) 1996-1997 Sam Leffler\br
Copyright (c) 1996 Pixar
-
+
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
@@ -389,11 +389,11 @@
Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Pixar, Sam Leffler and Silicon Graphics.
-
+
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
+
IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
@@ -423,8 +423,6 @@
\section1 JavaScriptCore
- \hr
-
Copyright (c) 1991, 2000, 2001 by Lucent Technologies.\br
Copyright (C) 2002, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
@@ -441,6 +439,60 @@
See \c src/3rdparty/webkit/JavaScriptCore/wtf/dtoa.cpp for license details.
+ \hr
+
+ Copyright (C) 2009 Company 100, Inc. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:\br
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.\br
+ 2. 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.
+
+ THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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.
+
+ \hr
+
+ Copyright (C) 2009 Apple Inc. All rights reserved.\br
+ Copyright (C) 2009 University of Szeged\br
+ All rights reserved.\br
+ Copyright (C) 2010 MIPS Technologies, Inc. All rights reserved.\br
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:\br
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.\br
+ 2. 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.
+
+ THIS SOFTWARE IS PROVIDED BY MIPS TECHNOLOGIES, INC. ``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 MIPS TECHNOLOGIES, INC. 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.
+
+
\section1 Pixman (\c pixman) version 0.17.11
\e{pixman is a library that provides low-level pixel manipulation
@@ -479,4 +531,156 @@
See \c src/3rdparty/pixman/pixman-arm-neon-asm.h and
\c src/3rdparty/pixman/pixman-arm-neon-asm.S
+
+ \section1 WebCore (WebKit)
+
+ Copyright (C) 2009 Ericsson AB\br
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.\br
+ 2. 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.\br
+ 3. Neither the name of Ericsson 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.
+
+ \hr
+
+ Copyright (C) 2004, Apple Computer, Inc. and The Mozilla Foundation.\br
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.\br
+ 2. 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.\br
+ 3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla
+ Foundation ("Mozilla") nor the names of their contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR 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 APPLE, MOZILLA OR
+ THEIR 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.
+
+ \hr
+
+ Copyright (C) 2009 Igalia S.L.\br
+ Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org>\br
+ Copyright (C) 2008 Christian Dywan <christian@imendio.com>\br
+ Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com>\br
+ Copyright (C) 2006 Charles Samuels <charles@kde.org>\br
+ Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com>\br
+ Copyright (C) 2009 Brent Fulgham\br
+ Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>\br
+ Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>\br
+ Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>\br
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:\br
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.\br
+ 2. 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.
+
+ THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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.
+
+ \hr
+
+ Copyright (C) 2007, 2008 Apple Inc. All rights reserved.\br
+ Copyright (C) IBM Corp. 2009 All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.\br
+ 2. 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.\br
+ 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.\br
+
+ THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
+
+ \hr
+
+ Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.\br
+ Copyright (C) 2010 François Sausset (sausset@gmail.com). All rights reserved\br
+ Copyright (C) 2007 Marius Renn <damarvy@gmail.com> All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:\br
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.\br
+ 2. 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.
+
+ 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.
*/
diff --git a/doc/src/legal/licenses.qdoc b/doc/src/legal/licenses.qdoc
index 96d5d29..a04a256 100644
--- a/doc/src/legal/licenses.qdoc
+++ b/doc/src/legal/licenses.qdoc
@@ -328,7 +328,7 @@
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.
-
+
\list
\o Parts of WebKit used by the QtWebKit module
\endlist
@@ -716,6 +716,53 @@
\list
\o Parts of WebKit used by the QtWebKit module
\endlist
+
+ \hr
+
+ Copyright (c) 1991-2009 Unicode, Inc. All rights reserved.
+ Distributed under the Terms of Use in
+ http://www.unicode.org/copyright.html.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of the Unicode data files and any associated
+ documentation (the "Data Files") or Unicode software and any
+ associated documentation (the "Software") to deal in the Data
+ Files or Software without restriction, including without
+ limitation the rights to use, copy, modify, merge, publish,
+ distribute, and/or sell copies of the Data Files or Software,
+ and to permit persons to whom the Data Files or Software are
+ furnished to do so, provided that (a) the above copyright
+ notice(s) and this permission notice appear with all copies
+ of the Data Files or Software, (b) both the above copyright
+ notice(s) and this permission notice appear in associated
+ documentation, and (c) there is clear notice in each modified
+ Data File or in the Software as well as in the documentation
+ associated with the Data File(s) or Software that the data or
+ software has been modified.
+
+ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT
+ WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED
+ IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
+ OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES
+ OR SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright
+ holder shall not be used in advertising or otherwise to promote
+ the sale, use or other dealings in these Data Files or Software
+ without prior written authorization of the copyright holder.
+
+ \list
+ \o Included in \c{util/unicode/data},
+ \c{tests/auto/qtextboundaryfinder/data} and
+ \c{tests/auto/qchar}
+ \o Parts of the \l makeqpf tool
+ \endlist
*/
/*!
diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc
index 67c13f2..bc016df 100644
--- a/doc/src/network-programming/bearermanagement.qdoc
+++ b/doc/src/network-programming/bearermanagement.qdoc
@@ -191,7 +191,7 @@ closed via \l{QNetworkSession::close()}, respectively. If the session
is \l{QNetworkSession::Disconnected}{disconnected} at the time of the
\l{QNetworkSession::open()}{open()} call the underlying interface is started;
otherwise only the reference counter against the global session is
-incremeted. The opposite behavior can be observed when using
+incremented. The opposite behavior can be observed when using
\l{QNetworkSession::close()}{close()}.
In some use cases it may be necessary to turn the interface off despite of
diff --git a/doc/src/platforms/mac-differences.qdoc b/doc/src/platforms/mac-differences.qdoc
index 766c619..2501656 100644
--- a/doc/src/platforms/mac-differences.qdoc
+++ b/doc/src/platforms/mac-differences.qdoc
@@ -175,6 +175,9 @@
\l{http://developer.apple.com/documentation/CoreFoundation/Reference/CFBundleRef/index.html}
{Apple's Developer Website}.
+ Note: QCoreApplication::applicationDirPath() can be used to determine
+ the path of the binary within the bundle.
+
\section2 Translating the Application Menu and Native Dialogs
The items in the Application Menu will be merged correctly for
diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc
index f355e7b..0bbf35f 100644
--- a/doc/src/porting/porting4.qdoc
+++ b/doc/src/porting/porting4.qdoc
@@ -472,7 +472,7 @@
\section1 Explicit Sharing
Qt 4 is the first version of Qt that contains no \link
- http://qt.nokia.com/doc/3.3/shclass.html explicitly shared
+ http://doc.qt.nokia.com/3.3/shclass.html explicitly shared
\endlink classes. All classes that were explicitly shared in Qt 3
are \e implicitly shared in Qt 4:
@@ -1079,7 +1079,7 @@
ensuring that the string is '\\0'-terminated. Another important
issue was that conversions between \c QCString and QByteArray often
gave confusing results. (See the
- \l{http://qt.nokia.com/doc/qq/qq05-achtung.html#qcstringisastringofchars}{Achtung!
+ \l{http://doc.qt.nokia.com/qq/qq05-achtung.html#qcstringisastringofchars}{Achtung!
Binary and Character Data} article in \e{Qt Quarterly} for an
overview of the pitfalls.)
@@ -2440,13 +2440,13 @@
that provides the old semantics. See the Q3Painter documentation
for details and for the reasons why we had to make this change.
- The \l{http://qt.nokia.com/doc/3.3/qpainter.html#CoordinateMode-enum}{QPainter::CoordinateMode}
+ The \l{http://doc.qt.nokia.com/3.3/qpainter.html#CoordinateMode-enum}{QPainter::CoordinateMode}
enum has been removed in Qt 4. All clipping
operations are now defined using logical coordinates and are subject
to transformation operations.
The
- \l{http://qt.nokia.com/doc/3.3/qpainter.html#RasterOP-enum}{QPainter::RasterOP}
+ \l{http://doc.qt.nokia.com/3.3/qpainter.html#RasterOP-enum}{QPainter::RasterOP}
enum has been replaced with QPainter::CompositionMode.
\section1 QPicture
@@ -3258,7 +3258,7 @@
\list \o If you use Q3SocketDevice in a thread to perform blocking
network I/O (a technique encouraged by the \e{Qt Quarterly}
- article \l{http://qt.nokia.com/doc/qq/qq09-networkthread.html}
+ article \l{http://doc.qt.nokia.com/qq/qq09-networkthread.html}
{Unblocking Networking}), you can now use QTcpSocket, QFtp, or
QNetworkAccessManager, which can be used from non-GUI threads.
@@ -4052,7 +4052,7 @@
Sample code on how to do obtain similar behavior from Qt 4, previously
handled by some of the above functions can be found in the
- \l{http://qt.nokia.com/doc/qwidget-qt3.html}{Qt 3 Support Members for QWidget}
+ \l{http://doc.qt.nokia.com/qwidget-qt3.html}{Qt 3 Support Members for QWidget}
page.
A widget now receives change events in its QWidget::changeEvent()
@@ -4150,7 +4150,7 @@
clearWFlags() has no direct replacement. You can use
QWidget::setAttribute() instead. For example,
\c{setAttribute(..., false)} to clear an attribute. More information
- is available \l{http://qt.nokia.com/doc/qwidget.html#setAttribute}{here}.
+ is available \l{http://doc.qt.nokia.com/qwidget.html#setAttribute}{here}.
testWFlags() was renamed to \l{QWidget::testAttribute()}{testAttribute()}.
diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc
index 89d564f..0c61285 100644
--- a/doc/src/qt-webpages.qdoc
+++ b/doc/src/qt-webpages.qdoc
@@ -141,7 +141,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/supported-platforms.html
+ \externalpage http://doc.qt.nokia.com/supported-platforms.html
\title Platform Support Policy
*/
@@ -151,7 +151,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/supported-platforms.html
+ \externalpage http://doc.qt.nokia.com/supported-platforms.html
\title Qt 4 Platforms Overview
*/
@@ -161,7 +161,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/qq/
+ \externalpage http://doc.qt.nokia.com/qq/
\title Qt Quarterly
*/
@@ -181,7 +181,7 @@
*/
/*!
- \externalpage http://qt.nokia.com/doc/qtcanvas
+ \externalpage http://doc.qt.nokia.com/qtcanvas
\title QtCanvas
*/
diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index 052e1c9..8867fd9 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -597,9 +597,9 @@
See \l{The State Machine Framework} documentation for more information.
- \section1 Multi-Touch and Gestures
+ \section1 Touch and Gestures
- Support for multi-touch input enables users to interact with many
+ Support for touch input enables users to interact with many
parts of a user interface at the same time, and provides the basis
for gestures. Additional infrastructure for gesture recognition
allows a sequence of touch inputs to be combined to create gestures
@@ -613,12 +613,12 @@
\list
\o Allows users to interact with applications in more natural ways.
\o Simplifies finger-based interaction with UI components.
- \o Combines support for common basic gestures and multi-touch gestures
+ \o Combines support for common basic gestures and touch gestures
in a single general framework.
\o Enables extensibility by design.
\endlist
- See the QTouchEvent class documentation for more information on multi-touch
+ See the QTouchEvent class documentation for more information on touch
input and QGestureEvent for gestures.
\section1 DOM access API
diff --git a/doc/src/snippets/code/doc_src_containers.qdoc b/doc/src/snippets/code/doc_src_containers.qdoc
index 5cf2aab..1f86f60 100644
--- a/doc/src/snippets/code/doc_src_containers.qdoc
+++ b/doc/src/snippets/code/doc_src_containers.qdoc
@@ -216,7 +216,7 @@ while (i.hasNext())
//! [17]
QLinkedList<QString> list;
...
-foreach (QString str, list)
+foreach (const QString &str, list)
qDebug() << str;
//! [17]
@@ -224,7 +224,7 @@ foreach (QString str, list)
//! [18]
QLinkedList<QString> list;
...
-foreach (QString str, list) {
+foreach (const QString &str, list) {
if (str.isEmpty())
break;
qDebug() << str;
@@ -235,7 +235,7 @@ foreach (QString str, list) {
//! [19]
QMap<QString, int> map;
...
-foreach (QString str, map.keys())
+foreach (const QString &str, map.keys())
qDebug() << str << ":" << map.value(str);
//! [19]
@@ -243,7 +243,7 @@ foreach (QString str, map.keys())
//! [20]
QMultiMap<QString, int> map;
...
-foreach (QString str, map.uniqueKeys()) {
+foreach (const QString &str, map.uniqueKeys()) {
foreach (int i, map.values(str))
qDebug() << str << ":" << i;
}
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index c46159c..0593567 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -250,12 +250,12 @@ export PATH
//! [38]
cd /home/user/qt/%VERSION%
-./configure -platform linux-g++ -xplatform symbian/linux-armcc -arch symbian
+./configure -platform linux-g++ -xplatform symbian/linux-armcc
//! [38]
//! [39]
cd /home/user/qt/%VERSION%
-./configure -platform linux-g++ -xplatform symbian/linux-gcce -arch symbian -no-webkit
+./configure -platform linux-g++ -xplatform symbian/linux-gcce -no-webkit
//! [39]
//! [40]
diff --git a/doc/src/snippets/code/doc_src_qalgorithms.qdoc b/doc/src/snippets/code/doc_src_qalgorithms.qdoc
index 78634a2..f5a73c6 100644
--- a/doc/src/snippets/code/doc_src_qalgorithms.qdoc
+++ b/doc/src/snippets/code/doc_src_qalgorithms.qdoc
@@ -217,7 +217,7 @@ QStringList list;
list << "AlPha" << "beTA" << "gamma" << "DELTA";
QMap<QString, QString> map;
-foreach (QString str, list)
+foreach (const QString &str, list)
map.insert(str.toLower(), str);
list = map.values();
diff --git a/doc/src/snippets/code/doc_src_qset.qdoc b/doc/src/snippets/code/doc_src_qset.qdoc
index ac48edb..c6e1933 100644
--- a/doc/src/snippets/code/doc_src_qset.qdoc
+++ b/doc/src/snippets/code/doc_src_qset.qdoc
@@ -80,7 +80,7 @@ while (i != set.constEnd()) {
//! [6]
QSet<QString> set;
...
-foreach (QString value, set)
+foreach (const QString &value, set)
qDebug() << value;
//! [6]
diff --git a/doc/src/snippets/code/doc_src_qt4-tulip.qdoc b/doc/src/snippets/code/doc_src_qt4-tulip.qdoc
index 3d88a0d..f29d3ba 100644
--- a/doc/src/snippets/code/doc_src_qt4-tulip.qdoc
+++ b/doc/src/snippets/code/doc_src_qt4-tulip.qdoc
@@ -47,7 +47,7 @@ foreach (variable, container)
//! [1]
QList<QString> list;
...
-foreach (QString str, list)
+foreach (const QString &str, list)
cout << str.ascii() << endl;
//! [1]
diff --git a/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp b/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
index 2e64505..fb62347 100644
--- a/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
+++ b/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
@@ -51,7 +51,7 @@ connect(quitButton, SIGNAL(clicked()), &app, SLOT(quit()));
//! [2]
-foreach (QString path, app.libraryPaths())
+foreach (const QString &path, app.libraryPaths())
do_something(path);
//! [2]
diff --git a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
index c93a25c..766b249 100644
--- a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
+++ b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
@@ -158,13 +158,13 @@ appname -session id
//! [10]
-foreach (QString command, mySession.restartCommand())
+foreach (const QString &command, mySession.restartCommand())
do_something(command);
//! [10]
//! [11]
-foreach (QString command, mySession.discardCommand())
+foreach (const QString &command, mySession.discardCommand())
do_something(command);
//! [11]
diff --git a/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp b/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
index 3871289..99deb20 100644
--- a/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
+++ b/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
@@ -68,7 +68,7 @@ void MyWidget::lookedUp(const QHostInfo &host)
return;
}
- foreach (QHostAddress address, host.addresses())
+ foreach (const QHostAddress &address, host.addresses())
qDebug() << "Found address:" << address.toString();
}
//! [3]
diff --git a/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp b/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
index 5c9421f..937dbb9 100644
--- a/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
+++ b/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
@@ -39,7 +39,7 @@
****************************************************************************/
//! [0]
-foreach (QSslCertificate cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", QSsl::Pem,
+foreach (const QSslCertificate &cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", QSsl::Pem,
QRegExp::Wildcard)) {
qDebug() << cert.issuerInfo(QSslCertificate::Organization);
}
diff --git a/doc/src/snippets/declarative/anchoranimation.qml b/doc/src/snippets/declarative/anchoranimation.qml
new file mode 100644
index 0000000..6c7aaf6
--- /dev/null
+++ b/doc/src/snippets/declarative/anchoranimation.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+ id: container
+ width: 200; height: 200
+
+ Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "red"
+ }
+
+ states: State {
+ name: "reanchored"
+ AnchorChanges { target: myRect; anchors.right: container.right }
+ }
+
+ transitions: Transition {
+ // smoothly reanchor myRect and move into new position
+ AnchorAnimation { duration: 1000 }
+ }
+
+ Component.onCompleted: container.state = "reanchored"
+}
+//![0]
diff --git a/doc/src/snippets/declarative/behavior.qml b/doc/src/snippets/declarative/behavior.qml
new file mode 100644
index 0000000..420dfc4
--- /dev/null
+++ b/doc/src/snippets/declarative/behavior.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: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$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ Behavior on width {
+ NumberAnimation { duration: 1000 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.width = 50
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/coloranimation.qml b/doc/src/snippets/declarative/coloranimation.qml
new file mode 100644
index 0000000..4e35f22
--- /dev/null
+++ b/doc/src/snippets/declarative/coloranimation.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ ColorAnimation on color { to: "yellow"; duration: 1000 }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/comments.qml b/doc/src/snippets/declarative/comments.qml
index f4bedb8..9be0ce5 100644
--- a/doc/src/snippets/declarative/comments.qml
+++ b/doc/src/snippets/declarative/comments.qml
@@ -38,8 +38,10 @@
**
****************************************************************************/
+//![0]
import Qt 4.7
+//![0]
Text {
text: "Hello world!" //a basic greeting
/*
@@ -49,3 +51,4 @@ Text {
font.family: "Helvetica"
font.pointSize: 24
}
+//![0]
diff --git a/doc/src/snippets/declarative/component.qml b/doc/src/snippets/declarative/component.qml
new file mode 100644
index 0000000..09c4aa2
--- /dev/null
+++ b/doc/src/snippets/declarative/component.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+ width: 100; height: 100
+
+ Component {
+ id: redSquare
+
+ Rectangle {
+ color: "red"
+ width: 10
+ height: 10
+ }
+ }
+
+ Loader { sourceComponent: redSquare }
+ Loader { sourceComponent: redSquare; x: 20 }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js
index 25bc10c..c29a1f9 100644
--- a/doc/src/snippets/declarative/componentCreation.js
+++ b/doc/src/snippets/declarative/componentCreation.js
@@ -1,7 +1,39 @@
-//![0]
+//![vars]
var component;
var sprite;
+//![vars]
+//![func]
+function createSpriteObjects() {
+//![func]
+
+//![remote]
+ component = Qt.createComponent("Sprite.qml");
+ if (component.status == Component.Ready)
+ finishCreation();
+ else
+ component.statusChanged.connect(finishCreation);
+//![remote]
+
+//![local]
+ component = Qt.createComponent("Sprite.qml");
+ sprite = component.createObject(appWindow);
+
+ if (sprite == null) {
+ // Error Handling
+ console.log("Error creating object");
+ } else {
+ sprite.x = 100;
+ sprite.y = 100;
+ // ...
+ }
+//![local]
+
+//![func-end]
+}
+//![func-end]
+
+//![finishCreation]
function finishCreation() {
if (component.status == Component.Ready) {
sprite = component.createObject(appWindow);
@@ -17,31 +49,4 @@ function finishCreation() {
console.log("Error loading component:", component.errorString());
}
}
-//![0]
-
-function createSpriteObjects() {
-
-//![1]
-component = Qt.createComponent("Sprite.qml");
-if (component.status == Component.Ready)
- finishCreation();
-else
- component.statusChanged.connect(finishCreation);
-//![1]
-
-//![2]
-component = Qt.createComponent("Sprite.qml");
-sprite = component.createObject(appWindow);
-
-if (sprite == null) {
- // Error Handling
- console.log("Error loading component:", component.errorString());
-} else {
- sprite.x = 100;
- sprite.y = 100;
- // ...
-}
-//![2]
-
-}
-
+//![finishCreation]
diff --git a/doc/src/snippets/declarative/createComponent-simple.qml b/doc/src/snippets/declarative/createComponent-simple.qml
new file mode 100644
index 0000000..9669580
--- /dev/null
+++ b/doc/src/snippets/declarative/createComponent-simple.qml
@@ -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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+ id: container
+ width: 300; height: 300
+
+ function loadButton() {
+ var component = Qt.createComponent("Button.qml");
+ if (component.status == Component.Ready) {
+ var button = component.createObject(container);
+ button.color = "red";
+ }
+ }
+
+ Component.onCompleted: loadButton()
+}
+//![0]
diff --git a/doc/src/snippets/declarative/createComponent.qml b/doc/src/snippets/declarative/createComponent.qml
index 8bfed07..0f9fad5 100644
--- a/doc/src/snippets/declarative/createComponent.qml
+++ b/doc/src/snippets/declarative/createComponent.qml
@@ -40,12 +40,12 @@
//![0]
import Qt 4.7
-import "componentCreation.js" as MyModule
+import "componentCreation.js" as MyScript
Rectangle {
id: appWindow
width: 300; height: 300
- Component.onCompleted: MyModule.createSpriteObjects();
+ Component.onCompleted: MyScript.createSpriteObjects();
}
//![0]
diff --git a/doc/src/snippets/declarative/createQmlObject.qml b/doc/src/snippets/declarative/createQmlObject.qml
index 380f6f1..a5f15f4 100644
--- a/doc/src/snippets/declarative/createQmlObject.qml
+++ b/doc/src/snippets/declarative/createQmlObject.qml
@@ -42,16 +42,19 @@ import Qt 4.7
Rectangle {
id: parentItem
- property QtObject newObject
width: 100
height: 100
function createIt() {
//![0]
-newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
+var newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
parentItem, "dynamicSnippet1");
//![0]
+
+//![destroy]
+newObject.destroy(1000);
+//![destroy]
}
Component.onCompleted: createIt()
diff --git a/doc/src/snippets/declarative/dynamicObjects-destroy.qml b/doc/src/snippets/declarative/dynamicObjects-destroy.qml
new file mode 100644
index 0000000..2c0c2fb
--- /dev/null
+++ b/doc/src/snippets/declarative/dynamicObjects-destroy.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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+ id: container
+ width: 500; height: 100
+
+ Component.onCompleted: {
+ var component = Qt.createComponent("SelfDestroyingRect.qml");
+ for (var i=0; i<5; i++) {
+ var object = component.createObject(container);
+ object.x = (object.width + 10) * i;
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/mouseareadragfilter.qml b/doc/src/snippets/declarative/mouseareadragfilter.qml
new file mode 100644
index 0000000..52ed10c
--- /dev/null
+++ b/doc/src/snippets/declarative/mouseareadragfilter.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+//! [dragfilter]
+import Qt 4.7
+
+Rectangle {
+ width: 480
+ height: 320
+ Rectangle {
+ x: 30; y: 30
+ width: 300; height: 240
+ color: "lightsteelblue"
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: parent;
+ drag.axis: "XAxis"
+ drag.minimumX: 30
+ drag.maximumX: 150
+ drag.filterChildren: true
+
+ Rectangle {
+ color: "yellow"
+ x: 50; y : 50
+ width: 100; height: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("Clicked")
+ }
+ }
+ }
+ }
+}
+//! [dragfilter]
diff --git a/doc/src/snippets/declarative/numberanimation.qml b/doc/src/snippets/declarative/numberanimation.qml
new file mode 100644
index 0000000..57d23b1
--- /dev/null
+++ b/doc/src/snippets/declarative/numberanimation.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ NumberAnimation on x { to: 50; duration: 1000 }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/parallelanimation.qml b/doc/src/snippets/declarative/parallelanimation.qml
new file mode 100644
index 0000000..d823b4f
--- /dev/null
+++ b/doc/src/snippets/declarative/parallelanimation.qml
@@ -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: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$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ ParallelAnimation {
+ running: true
+ NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
+ NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/parentanimation.qml b/doc/src/snippets/declarative/parentanimation.qml
new file mode 100644
index 0000000..7f11a43
--- /dev/null
+++ b/doc/src/snippets/declarative/parentanimation.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+ width: 200; height: 100
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: "red"
+ }
+
+ Rectangle {
+ id: blueRect
+ x: redRect.width
+ width: 50; height: 50
+ color: "blue"
+
+ states: State {
+ name: "reparented"
+ ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 }
+ }
+
+ transitions: Transition {
+ ParentAnimation {
+ NumberAnimation { properties: "x,y"; duration: 1000 }
+ }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/parentchange.qml b/doc/src/snippets/declarative/parentchange.qml
index 7f5718a..ea50832 100644
--- a/doc/src/snippets/declarative/parentchange.qml
+++ b/doc/src/snippets/declarative/parentchange.qml
@@ -41,9 +41,8 @@
//![0]
import Qt 4.7
-Rectangle {
- width: 200
- height: 100
+Item {
+ width: 200; height: 100
Rectangle {
id: redRect
diff --git a/doc/src/snippets/declarative/pathview/pathattributes.qml b/doc/src/snippets/declarative/pathview/pathattributes.qml
index 8d424a8..4daee63 100644
--- a/doc/src/snippets/declarative/pathview/pathattributes.qml
+++ b/doc/src/snippets/declarative/pathview/pathattributes.qml
@@ -49,8 +49,8 @@ Rectangle {
id: delegate
Item {
width: 80; height: 80
- scale: PathView.scale
- opacity: PathView.opacity
+ scale: PathView.iconScale
+ opacity: PathView.iconOpacity
Column {
Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
Text { text: name; font.pointSize: 16}
@@ -66,11 +66,11 @@ Rectangle {
delegate: delegate
path: Path {
startX: 120; startY: 100
- PathAttribute { name: "scale"; value: 1.0 }
- PathAttribute { name: "opacity"; value: 1.0 }
+ PathAttribute { name: "iconScale"; value: 1.0 }
+ PathAttribute { name: "iconOpacity"; value: 1.0 }
PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
- PathAttribute { name: "scale"; value: 0.3 }
- PathAttribute { name: "opacity"; value: 0.5 }
+ PathAttribute { name: "iconScale"; value: 0.3 }
+ PathAttribute { name: "iconOpacity"; value: 0.5 }
PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
}
}
diff --git a/doc/src/snippets/declarative/propertyanimation.qml b/doc/src/snippets/declarative/propertyanimation.qml
new file mode 100644
index 0000000..059cde5
--- /dev/null
+++ b/doc/src/snippets/declarative/propertyanimation.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** 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
+
+Row {
+
+//![transition]
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ states: State {
+ name: "moved"
+ PropertyChanges { target: rect; x: 50 }
+ }
+
+ transitions: Transition {
+ PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad }
+ }
+}
+//![transition]
+
+//![behavior]
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ Behavior on x { PropertyAnimation {} }
+
+ MouseArea { anchors.fill: parent; onClicked: parent.x = 50 }
+}
+//![behavior]
+
+//![propertyvaluesource]
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ PropertyAnimation { to: 50 }
+ PropertyAnimation { to: 0 }
+ }
+}
+//![propertyvaluesource]
+
+//![standalone]
+Rectangle {
+ id: theRect
+ width: 100; height: 100
+ color: "red"
+
+ // this is a standalone animation, it's not running by default
+ PropertyAnimation { id: animation; target: theRect; property: "width"; to: 30; duration: 500 }
+
+ MouseArea { anchors.fill: parent; onClicked: animation.running = true }
+}
+//![standalone]
+
+
+}
diff --git a/doc/src/snippets/declarative/qmldocuments.qml b/doc/src/snippets/declarative/qmldocuments.qml
new file mode 100644
index 0000000..c19a658
--- /dev/null
+++ b/doc/src/snippets/declarative/qmldocuments.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ property alias text: textItem.text
+
+ width: 100; height: 30
+ border.width: 1
+ radius: 5
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "darkGray" }
+ GradientStop { position: 0.5; color: "black" }
+ GradientStop { position: 1.0; color: "darkGray" }
+ }
+
+ Text {
+ id: textItem
+ anchors.centerIn: parent
+ font.pointSize: 20
+ color: "white"
+ }
+
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtobject.qml b/doc/src/snippets/declarative/qtobject.qml
new file mode 100644
index 0000000..970fa16
--- /dev/null
+++ b/doc/src/snippets/declarative/qtobject.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: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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+ QtObject {
+ id: attributes
+ property string name
+ property int size
+ property variant attributes
+ }
+
+ Text { text: attributes.name }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/rotationanimation.qml b/doc/src/snippets/declarative/rotationanimation.qml
new file mode 100644
index 0000000..c81395a
--- /dev/null
+++ b/doc/src/snippets/declarative/rotationanimation.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Item {
+ width: 300; height: 300
+
+ Rectangle {
+ id: rect
+ width: 150; height: 100; anchors.centerIn: parent
+ color: "red"
+ smooth: true
+
+ states: State {
+ name: "rotated"; PropertyChanges { target: rect; rotation: 180 }
+ }
+
+ transitions: Transition {
+ RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
+ }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: rect.state = "rotated" }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/sequentialanimation.qml b/doc/src/snippets/declarative/sequentialanimation.qml
new file mode 100644
index 0000000..a15f7f3
--- /dev/null
+++ b/doc/src/snippets/declarative/sequentialanimation.qml
@@ -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: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$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ SequentialAnimation {
+ running: true
+ NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
+ NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/smoothedanimation.qml b/doc/src/snippets/declarative/smoothedanimation.qml
new file mode 100644
index 0000000..20c90b5
--- /dev/null
+++ b/doc/src/snippets/declarative/smoothedanimation.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 800; height: 600
+ color: "blue"
+
+ Rectangle {
+ width: 60; height: 60
+ x: rect1.x - 5; y: rect1.y - 5
+ color: "green"
+
+ Behavior on x { SmoothedAnimation { velocity: 200 } }
+ Behavior on y { SmoothedAnimation { velocity: 200 } }
+ }
+
+ Rectangle {
+ id: rect1
+ width: 50; height: 50
+ color: "red"
+ }
+
+ focus: true
+ Keys.onRightPressed: rect1.x = rect1.x + 100
+ Keys.onLeftPressed: rect1.x = rect1.x - 100
+ Keys.onUpPressed: rect1.y = rect1.y - 100
+ Keys.onDownPressed: rect1.y = rect1.y + 100
+}
+//![0]
diff --git a/doc/src/snippets/declarative/dynamicObjects.qml b/doc/src/snippets/declarative/springanimation.qml
index 3698499..8e810e1 100644
--- a/doc/src/snippets/declarative/dynamicObjects.qml
+++ b/doc/src/snippets/declarative/springanimation.qml
@@ -38,32 +38,28 @@
**
****************************************************************************/
-import Qt 4.7
-
//![0]
-Rectangle {
- id: rootItem
- width: 300
- height: 300
+import Qt 4.7
- Component {
- id: rectComponent
+Item {
+ width: 300; height: 300
- Rectangle {
- id: rect
- width: 40; height: 40;
- color: "red"
+ Rectangle {
+ id: rect
+ width: 50; height: 50
+ color: "red"
- NumberAnimation on opacity { from: 1; to: 0; duration: 1000 }
+ Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } }
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } }
+ }
- Component.onCompleted: rect.destroy(1000);
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ rect.x = mouse.x - rect.width/2
+ rect.y = mouse.y - rect.height/2
}
}
-
- function createRectangle() {
- var object = rectComponent.createObject(rootItem);
- }
-
- Component.onCompleted: createRectangle()
}
//![0]
+
diff --git a/doc/src/snippets/declarative/state-when.qml b/doc/src/snippets/declarative/state-when.qml
new file mode 100644
index 0000000..6d3bb75
--- /dev/null
+++ b/doc/src/snippets/declarative/state-when.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: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]
+Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "hidden"; when: mouseArea.pressed
+ PropertyChanges { target: myRect; opacity: 0 }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml
index a99c2e2..ce2653b 100644
--- a/doc/src/snippets/declarative/state.qml
+++ b/doc/src/snippets/declarative/state.qml
@@ -46,24 +46,17 @@ Rectangle {
width: 100; height: 100
color: "black"
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked';
+ }
+
states: [
State {
name: "clicked"
- PropertyChanges {
- target: myRect
- color: "red"
- }
+ PropertyChanges { target: myRect; color: "red" }
}
]
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (myRect.state == "") // i.e. the default state
- myRect.state = "clicked";
- else
- myRect.state = "";
- }
- }
}
//![0]
diff --git a/doc/src/snippets/declarative/states.qml b/doc/src/snippets/declarative/states.qml
index c3b1796..127e3a7 100644
--- a/doc/src/snippets/declarative/states.qml
+++ b/doc/src/snippets/declarative/states.qml
@@ -40,42 +40,22 @@
****************************************************************************/
//![0]
import Qt 4.7
-
-Item {
- id: myItem
+
+Rectangle {
+ id: myRect
width: 200; height: 200
+ color: "red"
- Rectangle {
- id: myRect
- width: 100; height: 100
- color: "red"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myRect.state = 'moved'
}
states: [
State {
name: "moved"
- PropertyChanges {
- target: myRect
- x: 50
- y: 50
- }
+ PropertyChanges { target: myRect; x: 50; y: 50 }
}
]
-
- MouseArea {
- anchors.fill: parent
- onClicked: myItem.state = 'moved'
- }
-//![0]
-
-//![transitions]
-transitions: [
- Transition {
- NumberAnimation { properties: "x,y"; duration: 500 }
- }
-]
-//![transitions]
-
-//![1]
}
-//![1]
+//![0]
diff --git a/doc/src/snippets/declarative/transition-from-to.qml b/doc/src/snippets/declarative/transition-from-to.qml
new file mode 100644
index 0000000..615de17
--- /dev/null
+++ b/doc/src/snippets/declarative/transition-from-to.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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]
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "brighter"; when: mouseArea.pressed
+ PropertyChanges { target: rect; color: "yellow" }
+ }
+
+ transitions: Transition {
+ ColorAnimation { duration: 1000 }
+ }
+}
+//![0]
+
+
diff --git a/doc/src/snippets/declarative/transition-reversible.qml b/doc/src/snippets/declarative/transition-reversible.qml
new file mode 100644
index 0000000..8a7b69a
--- /dev/null
+++ b/doc/src/snippets/declarative/transition-reversible.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** 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]
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "brighter"
+ when: mouseArea.pressed
+ PropertyChanges { target: rect; color: "yellow"; x: 50 }
+ }
+
+ transitions: Transition {
+ SequentialAnimation {
+ PropertyAnimation { property: "x"; duration: 1000 }
+ ColorAnimation { duration: 1000 }
+ }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/transition.qml b/doc/src/snippets/declarative/transition.qml
new file mode 100644
index 0000000..b884750
--- /dev/null
+++ b/doc/src/snippets/declarative/transition.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: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$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ states: State {
+ name: "moved"
+ PropertyChanges { target: rect; x: 50; y: 50 }
+ }
+
+ transitions: Transition {
+ PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/droparea.cpp b/doc/src/snippets/droparea.cpp
index bbcf82d..bb49dd7 100644
--- a/doc/src/snippets/droparea.cpp
+++ b/doc/src/snippets/droparea.cpp
@@ -130,7 +130,7 @@ QPixmap DropArea::extractPixmap(const QByteArray &data, const QString &format)
QList<QByteArray> imageFormats = QImageReader::supportedImageFormats();
QPixmap pixmap;
- foreach (QByteArray imageFormat, imageFormats) {
+ foreach (const QByteArray &imageFormat, imageFormats) {
if (format.mid(6) == QString(imageFormat)) {
pixmap.loadFromData(data, imageFormat);
break;
diff --git a/doc/src/snippets/picture/picture.cpp b/doc/src/snippets/picture/picture.cpp
index 0c5712a..5283978 100644
--- a/doc/src/snippets/picture/picture.cpp
+++ b/doc/src/snippets/picture/picture.cpp
@@ -76,7 +76,7 @@ int main()
// FORMATS
//! [2]
QStringList list = QPicture::inputFormatList();
- foreach (QString string, list)
+ foreach (const QString &string, list)
myProcessing(string);
//! [2]
}
@@ -85,7 +85,7 @@ int main()
// OUTPUT
//! [3]
QStringList list = QPicture::outputFormatList();
- foreach (QString string, list)
+ foreach (const QString &string, list)
myProcessing(string);
//! [3]
}
diff --git a/doc/src/snippets/qfontdatabase/main.cpp b/doc/src/snippets/qfontdatabase/main.cpp
index 7f939de..1b8ff42 100644
--- a/doc/src/snippets/qfontdatabase/main.cpp
+++ b/doc/src/snippets/qfontdatabase/main.cpp
@@ -50,11 +50,11 @@ int main(int argc, char **argv)
fontTree.setColumnCount(2);
fontTree.setHeaderLabels(QStringList() << "Font" << "Smooth Sizes");
- foreach (QString family, database.families()) {
+ foreach (const QString &family, database.families()) {
QTreeWidgetItem *familyItem = new QTreeWidgetItem(&fontTree);
familyItem->setText(0, family);
- foreach (QString style, database.styles(family)) {
+ foreach (const QString &style, database.styles(family)) {
QTreeWidgetItem *styleItem = new QTreeWidgetItem(familyItem);
styleItem->setText(0, style);
diff --git a/doc/src/snippets/qlistview-dnd/model.cpp b/doc/src/snippets/qlistview-dnd/model.cpp
index d310c03..bca71ee 100644
--- a/doc/src/snippets/qlistview-dnd/model.cpp
+++ b/doc/src/snippets/qlistview-dnd/model.cpp
@@ -109,7 +109,7 @@ bool DragDropListModel::dropMimeData(const QMimeData *data,
//! [6]
insertRows(beginRow, rows, QModelIndex());
- foreach (QString text, newItems) {
+ foreach (const QString &text, newItems) {
QModelIndex idx = index(beginRow, 0, QModelIndex());
setData(idx, text);
beginRow++;
@@ -139,7 +139,7 @@ QMimeData *DragDropListModel::mimeData(const QModelIndexList &indexes) const
QDataStream stream(&encodedData, QIODevice::WriteOnly);
- foreach (QModelIndex index, indexes) {
+ foreach (const QModelIndex &index, indexes) {
if (index.isValid()) {
QString text = data(index, Qt::DisplayRole).toString();
stream << text;
diff --git a/doc/src/snippets/qstringlist/main.cpp b/doc/src/snippets/qstringlist/main.cpp
index 76785f1..9ada319 100644
--- a/doc/src/snippets/qstringlist/main.cpp
+++ b/doc/src/snippets/qstringlist/main.cpp
@@ -118,7 +118,7 @@ Widget::Widget(QWidget *parent)
result.clear();
//! [12]
- foreach (QString str, list) {
+ foreach (const QString &str, list) {
if (str.contains("Bill"))
result += str;
}
diff --git a/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp b/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp
index 2d01240..620a716 100644
--- a/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp
+++ b/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp
@@ -123,7 +123,7 @@ QMimeData *DragDropModel::mimeData(const QModelIndexList &indexes) const
QDataStream stream(&encodedData, QIODevice::WriteOnly);
- foreach (QModelIndex index, indexes) {
+ foreach (const QModelIndex &index, indexes) {
if (index.isValid()) {
QString text = data(index, Qt::DisplayRole).toString();
stream << index.internalId() << index.row() << index.column() << text;
diff --git a/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp b/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
index 6a49be8..35d2fa7 100644
--- a/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
+++ b/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
@@ -72,9 +72,9 @@ int main(int argc, char *argv[])
<< (QStringList() << "David Bradley" << "42")
<< (QStringList() << "Knut Walters" << "25")
<< (QStringList() << "Andrea Jones" << "34");
- foreach (QStringList row, rows) {
+ foreach (const QStringList &row, rows) {
QList<QStandardItem *> items;
- foreach (QString text, row)
+ foreach (const QString &text, row)
items.append(new QStandardItem(text));
model.appendRow(items);
}
diff --git a/doc/src/template/style/OfflineStyle.css b/doc/src/template/style/OfflineStyle.css
deleted file mode 100644
index 9f5d28b..0000000
--- a/doc/src/template/style/OfflineStyle.css
+++ /dev/null
@@ -1,251 +0,0 @@
-@media screen
-{
-
- .wrapper
- {
- top:50px;
- background: none;
-
- }
- .wrapper .bd
- {
- background: none;
- position: relative;
- }
-
-
-
-
- body.offline
- {
- background-image: none;
- background-color: #FFFFFF;
-
- }
-
- .offline .footer {
- margin: 0;
- }
- .offline .header
- {
- width: 100%;
- margin: 0;
- height: auto;
- background-color: #ffffff;
- padding: 10px 0 5px 0;
- overflow: visible;
- border-bottom: solid #E5E5E5 1px;
- z-index:1;
- position:fixed;
- }
-
- .offline .header .content
- {
- }
- .offline .header .qtref
- {
- color: #00732F;
- position: static;
- float: left;
- margin-left: 5px;
- font: bold 18px/1 Arial;
- }
-
- .offline .header .qtref:visited
- {
- color: #00732F;
- }
- .offline .header .qtref:hover
- {
- color: #00732F;
- text-decoration:none;
- }
- .offline .header .qtref span
- {
- background-image: none;
- text-indent: 0;
- text-decoration:none;
- }
-
- .offline .wrap
- {
- margin: 0 5px 0 5px;
- }
-
- .offline .wrap .toolbar
- {
- display:block;
- padding-top:5px;
- }
-
- .offline .wrap .breadcrumb ul li {
- font-weight: normal;
- }
-
- .offline .wrap .breadcrumb ul li a {
- /*color: #44a51c;*/
- }
-
- .offline .wrap .breadcrumb ul li.last a {
- /*color: #363534;*/
- }
-
-
-
- .narrow .indexboxcont .section {
- width: 64%;
- padding-left: 0;
- }
-
- .narrow .indexboxcont .sectionlist {
- width: 32.5%;
- }
-
- .header .icon,
- .sidebar,
- .feedback,
- .t_button,
- .feedback,
- #feedbackBox,
- #feedback,
- #blurpage,
- .indexbox .indexIcon span,
- .wrapper .hd,
- .offline .indexbox .indexIcon,
- .offline .header #nav-logo,
- #offlinemenu,
- #offlinesearch,
- .offline .header #nav-topright,
- .offline .header #shortCut ,
- .offline .wrapper .hd,
- .offline .wrapper .ft,
- .offline .sidebar,
- .offline .wrap .feedback
- {
- display:none;
- }
-
- /* end offline mode */
-#narrowmenu {
- display: none;
- float: right;
- margin: 15px 40px 0 0;
- font-size: 11px;
- }
-
- .narrow #narrowmenu {
- display: block;
- }
-
- #narrowsearch{
- display:none;
- }
-
- #narrowmenu ul
- {
- border-bottom:solid 1px #E5E5E5;
- border-left:solid 1px #E5E5E5;
- border-right:solid 1px #E5E5E5;
- }
-
- #narrowmenu a {
- line-height: 1.1;
- background: url(../images/arrow_down.png) no-repeat 100% 50%;
- white-space: nowrap;
- padding: 0 16px 0 5px;
- }
-
- #narrowmenu li {
- margin-left: 20px;
- }
-
- #narrowmenu li li {
- margin: 0 0 5px 0;
- }
-
- #narrowmenu li li a {
- padding: 0;
- background-image: none;
- }
-
- #narrowmenu li,
- #narrowmenu li ul {
- background-color: #fff;
- }
-
- #narrowmenu li ul {
- width: auto;
- padding: 5px;
- margin-top:-15px;
- }
-
- .sf-menu li:hover ul, .sf-menu li.sfHover ul {
- top: 1.2em;
- }
-.sf-menu, .sf-menu * {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.sf-menu {
- line-height: 1.0;
-}
-.sf-menu ul {
- position: absolute;
- top: -999em;
- width: 10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
- width: 100%;
-}
-.sf-menu li:hover {
- visibility: inherit; /* fixes IE7 'sticky bug' */
-}
-.sf-menu li {
- float: left;
- position: relative;
-}
-.sf-menu a {
- display: block;
- position: relative;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
- left: 0;
- top: 2.5em; /* match top ul list item height */
- z-index: 99;
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
- .wrap .content ol li {
- background:none;
- font:400 10pt/1 Verdana;
- margin-bottom:10px;
- margin-left:12px;
- }
- .wrap .content ol li {
- list-style-type:decimal;
-
- }
-
-
-
-}
-/* end of screen media */
-
diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css
index 05159aa..e4ad135 100644
--- a/doc/src/template/style/narrow.css
+++ b/doc/src/template/style/narrow.css
@@ -15,7 +15,12 @@
}
.narrow .footer {
- margin: 0;
+ margin: 0px;
+ }
+
+ .creator .header, .creator .header .content, .creator .footer, .creator .wrapper {
+ margin: 0px;
+ min-width: 300px;
}
.narrow .header
{
@@ -126,6 +131,11 @@
margin: 0 5px 0 5px;
}
+ .creator .wrap
+ {
+ margin: 0px;
+ background:#FFFFFF;
+ }
.narrow .wrap .toolbar
{
border-bottom: none;
@@ -135,7 +145,14 @@
{
padding-top: 15px;
}
-
+ .creator .wrap .content
+ {
+ padding-top: 10px;
+ }
+ .creator .wrap .content .guide
+ {
+ padding-top: 15px;
+ }
.narrow .wrap .feedback
{
display: none;
diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index 9f80921..9b37693 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -1345,7 +1345,7 @@
font: normal 13px/1.2 Verdana;
color: #363534;
- background-color: #FFFFFF;
+ background-color: #FAFAFA;
}
@@ -1406,7 +1406,9 @@
border-bottom:1px solid #E5E5E5;
- width:100%,
+ /*width:100%;*/
+ margin-left:-5px;
+ margin-right:-5px;
}
.creator .wrap .breadcrumb ul li a
{
@@ -1550,18 +1552,17 @@
@media print
{
- input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
+ input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult
{
display: none;
background: none;
}
.content
{
- position: absolute;
- top: 0px;
- left: 0px;
background: none;
display: block;
+ width: 100%; margin: 0; float: none;
+
}
}
/* end of print media */
diff --git a/doc/src/template/style/superfish_skin.css b/doc/src/template/style/superfish_skin.css
deleted file mode 100644
index 8d84827..0000000
--- a/doc/src/template/style/superfish_skin.css
+++ /dev/null
@@ -1,83 +0,0 @@
-
-/*** DEMO SKIN ***/
-.sf-menu {
- float: left;
- margin-bottom: 1em;
-}
-.sf-menu a {
- border-left: 1px solid #fff;
- border-top: 1px solid #CFDEFF;
- padding: .75em 1em;
- text-decoration:none;
-}
-.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
- color: #13a;
-}
-.sf-menu li {
- background: #BDD2FF;
-}
-.sf-menu li li {
- background: #AABDE6;
-}
-.sf-menu li li li {
- background: #9AAEDB;
-}
-.sf-menu li:hover, .sf-menu li.sfHover,
-.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
- background: #CFDEFF;
- outline: 0;
-}
-
-/*** arrows **/
-.sf-menu a.sf-with-ul {
- padding-right: 2.25em;
- min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
-}
-.sf-sub-indicator {
- position: absolute;
- display: block;
- right: .75em;
- top: 1.05em; /* IE6 only */
- width: 10px;
- height: 10px;
- text-indent: -999em;
- overflow: hidden;
- background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
-}
-a > .sf-sub-indicator { /* give all except IE6 the correct values */
- top: .8em;
- background-position: 0 -100px; /* use translucent arrow for modern browsers*/
-}
-/* apply hovers to modern browsers */
-a:focus > .sf-sub-indicator,
-a:hover > .sf-sub-indicator,
-a:active > .sf-sub-indicator,
-li:hover > a > .sf-sub-indicator,
-li.sfHover > a > .sf-sub-indicator {
- background-position: -10px -100px; /* arrow hovers for modern browsers*/
-}
-
-/* point right for anchors in subs */
-.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
-.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
-/* apply hovers to modern browsers */
-.sf-menu ul a:focus > .sf-sub-indicator,
-.sf-menu ul a:hover > .sf-sub-indicator,
-.sf-menu ul a:active > .sf-sub-indicator,
-.sf-menu ul li:hover > a > .sf-sub-indicator,
-.sf-menu ul li.sfHover > a > .sf-sub-indicator {
- background-position: -10px 0; /* arrow hovers for modern browsers*/
-}
-
-/*** shadows for all but IE6 ***/
-.sf-shadow ul {
- background: url('../images/shadow.png') no-repeat bottom right;
- padding: 0 8px 9px 0;
- -moz-border-radius-bottomleft: 17px;
- -moz-border-radius-topright: 17px;
- -webkit-border-top-right-radius: 17px;
- -webkit-border-bottom-left-radius: 17px;
-}
-.sf-shadow ul.sf-shadow-off {
- background: transparent;
-}
diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
new file mode 100755
index 0000000..98096a0
--- /dev/null
+++ b/doc/src/tutorials/modelview.qdoc
@@ -0,0 +1,938 @@
+/****************************************************************************
+**
+** 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:FDL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in a
+** written agreement between you and Nokia.
+**
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page modelview.html
+
+ \startpage {index.html}{Qt Reference Documentation}
+ \nextpage {modelview-part1.html}{Introduction}
+
+ \title Model/View Contents
+ \brief An introduction to ModelView programming
+
+ This tutorial gives an introduction to ModelView programming using the Qt
+ cross-platform framework.
+
+ \image treeview.png
+
+ \omit
+ It doesn't cover everything; the emphasis is on teaching the programming
+ philosophy of Model/View programming, and Qt's features are introduced as
+ needed. Some commonly used features are never used in this tutorial.
+ \endomit
+
+ In the process, we will learn about some basic technologies provided by Qt,
+ such as:
+
+ \list
+ \o The difference between standard and model/view widgets
+ \o Adapters betweeen forms and models
+ \o Developing a simple model/view application
+ \o Intermediate topics such as:
+ \list
+ \o Tree views
+ \o Selection
+ \o Predefined models
+ \o Delegates
+ \o Debugging with model test
+ \endlist
+ \endlist
+
+ If you are completely new to Qt, please read \l{How to Learn Qt} if you
+ have not already done so.
+
+ The tutorial's source code is located in Qt's \c examples/tutorials/modelview
+ directory.
+
+ \list 1
+ \o \l{modelview-part1.html}{Introduction}
+ \o \l{modelview-part2.html}{Developing a Simple Model/View Application}
+ \o \l{modelview-part3.html}{Intermediate Topics}
+ \o \l{modelview-part4.html}{Good Sources of Additional Information}
+ \endlist
+
+
+*/
+
+/*!
+ \page modelview-part1.html
+ \contentspage {modelview-index.html}{Model/View Contents}
+ \previouspage {modelview-index.html}{Model/View Contents}
+ \nextpage {modelview-part2.html}{Developing a Simple Model/View Application}
+ \title An Introduction to Model/View Programming
+
+ \section1 1. Introduction
+
+ Model/View is a technology used to separate data from views in widgets that
+ handle data sets. Standard widgets are not designed for separating data
+ from views and this is why Qt 4 has two different types of widgets. Both
+ types of widgets look the same, but they interact with data differently.
+
+ \table
+ \row
+ \o Standard widgets use data that is part of the widget.
+ \o \image standardwidget.png
+ \row
+ \o View classes operate on external data (the model)
+ \o \image modelview.png
+ \endtable
+
+ \section2 1.1 Standard Widgets
+
+ Let's have a closer look at a standard table widget. A table widget is a 2D
+ array of the data elements that the user can change. The table widget can
+ be integrated into a program flow by reading and writing the data elements
+ that the table widget provides. This method is very intuitive and useful in
+ many applications.
+
+ Displaying and editing a database table with a standard table widget can be
+ problematic. Two copies of the data have to be coordinated: one outside the
+ widget; one inside the widget. The developer needs to know where up-to-date
+ data is so the both copies contain the most recent data. The tight coupling
+ of presentation and data makes it harder to write unit tests.
+
+ \section2 1.2 Model/View to the Rescue
+
+ Model/view stepped up to provide a solution that uses a more versatile
+ architecture. Model/view eliminates the data consistency problems that may
+ occur with standard widgets. Model/view also makes it easier to use more
+ than one view of the same data because one model can be passed on to many
+ views. The most important difference is that model/view widgets do not
+ store data behind the table cells. In fact, they operate directly from your
+ data. Since view classes do not know your data's structure, you need to
+ provide a wrapper to make your data conform to the QAbstractItemModel
+ interface. A view uses this interface to read from and write to your data
+ and any class that implements QAbstractItemModel is a model. Once the view
+ receives a pointer to a model, it will read and display its content and be
+ its editor.
+
+ \section2 1.3 Overview of the Model/View Widgets
+
+ Here is an overview of the model/view widgets and their corresponding
+ standard widgets.
+
+ \table
+ \header
+ \o Widget
+ \o Standard Widget (a convenience class with data in
+ the widget)
+ \o Model/View View Class (for use with external data)
+ \row
+ \o \inlineimage listview.png
+ \o \l QListWidget
+ \o \l QListView
+ \row
+ \o \inlineimage tableview.png
+ \o \l QTableWidget
+ \o \l QTableView
+ \row
+ \o \inlineimage treeview.png
+ \o \l QTreeWidget
+ \o \l QTreeView
+ \row
+ \o \inlineimage columnview.png
+ \o
+ \o \l QColumnView shows a tree as a hierarchy of lists
+ \row
+ \o \inlineimage combobox.png
+ \o {2, 1} \l QComboBox can work as both a view class and also
+ as a traditional widget
+ \endtable
+
+ \section2 1.4 Using Adapters between Forms and Models
+
+ Having adapters between forms and models can come in handy.
+
+ We often prefer editing data stored in tables (e.g. in database tables) in
+ forms rather than in tables. There is no direct model/view counterpart for
+ separating data and views for widgets that operate on one value instead of
+ a dataset, so we need an adapter in order to connect the form to the source
+ of data.
+
+ \l QDataWidgetMapper is a great solution because it maps form widgets to a
+ table row and it makes it very easy to build forms for database tables.
+
+ \image widgetmapper.png
+
+ Another example of an adapter is QCompleter. Qt has QCompleter for
+ providing auto-completions in Qt widgets such as QComboBox and, as shown
+ below, QLineEdit. QCompleter uses a model as its data source, so QCompleter,
+ in itself, is a very handy adapter.
+
+ \image qcompleter.png
+*/
+
+/*!
+ \page modelview-part2-main-cpp.html
+ \title main.cpp
+ \quotefile tutorials/modelview/1_readonly/main.cpp
+*/
+
+/*!
+ \page modelview-part2.html
+ \contentspage {modelview-index.html}{Model/View Contents}
+ \previouspage {modelview-part1.html}{Introduction}
+ \nextpage {modelview-part3.html}{Intermediate Topics}
+ \title Model/View Chapter 2 - A Simple Model/View Application
+
+ \section1 2. A Simple Model/View Application
+
+ If you want to develop a model/view application, where should you start? We
+ recommend starting with a simple example and extending it step-by-step.
+ This makes understanding the architecture a lot easier. Trying to
+ understand the model/view architecture in detail before invoking the IDE
+ has proven to be less convenient for many developers. It is substantially
+ easier to start with a simple model/view application that has demo data.
+ Give it a try! Simply replace the data in the examples below with your own.
+
+ Below are 7 very simple and independent applications that show different
+ sides of model/view programming. The source code can be found inside the
+ \c{examples/tutorials/modelview} directory.
+
+ \section2 2.1 A Read Only Table
+
+ We start with an application that uses a QTableView to show data. We will
+ add editing capabilities later.
+
+ \snippet examples/tutorials/modelview/1_readonly/main.cpp Quoting ModelView Tutorial
+
+ We have the usual \l {modelview-part2-main-cpp.html}{main()} function:
+
+ \snippet examples/tutorials/modelview/1_readonly/modelview.h Quoting ModelView Tutorial
+
+ The application is a \l QMainWindow that holds a \l QTableView.
+
+ \snippet examples/tutorials/modelview/1_readonly/modelview.cpp Quoting ModelView Tutorial
+
+ Here is the interesting part: We use
+ \l{QTableView::setModel()}{tableView->setModel(new MyModel(this));} to
+ instantiate the Model and pass its pointer to \l {QTableView}{tableView()}.
+ \l{QTableView}{tableView} will invoke the methods of the pointer it has
+ received to find out two things:
+
+ \list
+ \o How many rows and columns should be displayed
+ \o What content should be printed into each cell.
+ \endlist
+
+ The model needs some code to respond to this.
+
+ We have a table data set, so let's start with QAbstractTableModel since it
+ is easier to use.
+
+ \snippet examples/tutorials/modelview/1_readonly/mymodel.h Quoting ModelView Tutorial
+
+ QAbstractTableModel requires the implementation of three abstract methods.
+
+ \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp Quoting ModelView Tutorial
+
+ The number of rows and columns is set by
+ \l{QAbstractItemModel::rowCount()}{MyModel::rowCount()} and
+ \l{QAbstractItemModel::columnCount()}{MyModel::columnCount()}.
+ When the view has to know what the cell's text is, it calls the method.
+ Row and column information is specified with parameter \c index and the
+ role is set to \l{Qt::ItemDataRole}{Qt::DisplayRole}. Other roles are
+ covered in the next section. In our example, the data that should be
+ displayed is generated. In a real application, \c MyModel would have a
+ member called \c MyData, which serves as the target for all reading and
+ writing operations.
+
+ This small example demonstrates the passive nature of a model. The model
+ does not know when it will be used or which data is needed. It simply
+ provides data each time the view requests it.
+
+ What happens when the model 's data needs to be changed? How does the view
+ know when data changes and needs to be read again? The model has to emit a
+ signal that indicates what range of cells has changed. This will be
+ demonstrated in section 2.3.
+
+ \section2 2.2 Extending the Read Only Example with Roles
+
+ In addition to controlling what text the view displays, the model also
+ controls the text's appearance. When we slightly change the model, we get
+ the following result: \image readonlytable_role.png
+
+ In fact, nothing except for the \l{QAbstractItemModel::}{data()}
+ method needs to be changed to set fonts, background colour, alignment and a
+ checkbox.
+ Here is the \l{QAbstractItemModel::data()}{data()} method that produces the
+ result shown above:
+
+ \snippet examples/tutorials/modelview/2_formatting/mymodel.cpp Quoting ModelView Tutorial
+
+ Each formatting property will be requested from the model with a separate
+ call to the \l{QAbstractItemModel::data()}{data()} method. The \c role
+ parameter is used to let the model know which property is being requested:
+
+ \table
+ \header
+ \o Role (enum Qt::ItemDataRole )
+ \o Meaning
+ \o Type
+ \row
+ \o \l{Qt::ItemDataRole}{Qt::DisplayRole}
+ \o text
+ \o QString
+ \row
+ \o Qt::FontRole
+ \o font
+ \o QFont
+ \row
+ \o Qt::BackgroundRole
+ \o brush for the background of the cell
+ \o QBrush
+ \row
+ \o Qt::TextAlignmentRole
+ \o text alignment
+ \o enum Qt::AlignmentFlag
+ \row
+ \o {1, 3} Qt::CheckStateRole
+ \o {1, 3} suppresses checkboxes with \l{QVariant}{QVariant()},
+ sets checkboxes with Qt::Checked or Qt::Unchecked
+ \o {1, 3} \l{Qt::ItemDataRole}{enum Qt::ItemDataRole}
+ \endtable
+
+ Refer to the Qt namespace documentation to learn more about the
+ Qt::ItemDataRole enum's capabilities.
+
+ Now we need to determine how using a seperated model impacts the
+ application's performance, so let's trace how often the view calls the
+ \l{QAbstractItemModel::}{data()} method. In order to track how often
+ the view calls the model, we have put a debug statement in the
+ \l{QAbstractItemModel::}{data()} method, which logs onto stdio. In
+ our small example, \l{QAbstractItemModel::}{data()} will be called 42
+ times.
+ Each time you hover the cursor over the field,
+ \l{QAbstractItemModel::}{data()} will be called again \mdash 7 times for
+ each cell. That's why it is important to make sure that your data is
+ available when \l{QAbstractItemModel::}{data()} is invoked and expensive
+ lookup operations are cached.
+
+ \section2 2.3 A Clock inside a Table Cell
+
+ \image clock.png
+
+ We still have a read only table, but this time the content changes every
+ second because we are showing the current time.
+
+ \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_QVariant
+
+ Something is missing to make the clock tick. We need to tell the view every
+ second that the time has changed and that it needs to be read again. We do
+ this with a timer. In the constructor, we set its interval to 1 second and
+ connect its timeout signal.
+
+ \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_a
+
+ Here is the corresponding slot:
+
+ \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_b
+
+ We ask the view to read the data in the top left cell again by emitting the
+ \l{QAbstractItemModel::}{dataChanged()} signal. Note that we did not
+ explicitly connect the \l{QAbstractItemModel::}{dataChanged()} signal to
+ the view. This happened automatically when we called
+ \l{QTableView::}{setModel()}.
+
+ \section2 2.4 Setting up Headers for Columns and Rows
+
+ Headers can be hidden via a view method: \c{tableView->verticalHeader()->hide();}
+ \image header.png
+
+ The header content, however, is set via the model, so we reimplement the
+ \l{QAbstractItemModel::headerData()}{headerData()} method:
+
+ \snippet examples/tutorials/modelview/4_headers/mymodel.cpp quoting mymodel_c
+
+
+ \section2 2.5 The Minimal Editing Example
+
+ In this example, we are going to build an application that automatically
+ populates a window title with content by repeating values entered into
+ table cells.
+
+ The model decides whether editing capabilities are available . We only have
+ to modify the model in order for the available editing capabilities to be
+ enabled. This is done by reimplementing the following virtual methods:
+ \l{QAbstractItemModel::}{setData()} and \l{QAbstractItemModel::}{flags()}.
+
+ \snippet examples/tutorials/modelview/5_edit/mymodel.h Quoting ModelView Tutorial
+
+ We use \c QStringList m_gridData to store our data. This makes
+ \c m_gridData the core of MyModel. The rest of \c MyModel acts like a
+ wrapper and adapts \c m_gridData to the QAbstractItemModel interface. We
+ have also introduced the \c editCompleted() signal,
+ which makes it possible to transfer the modified text to the window title.
+
+ \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_d
+
+ In the constructor, we fill \c QStringList gridData with 6 items (one item
+ for every field in the table):
+
+ \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_e
+
+ \l{QAbstractItemModel::setData()}{setData()} will be called each time the
+ user edits a cell. The \c index parameter tells us which field has been
+ edited and \c value provides the result of the editing process. The role
+ will always be set to \c Qt::EditRole because our cells only contain text.
+ If a checkbox were present and user permissions are set to allow the
+ checkbox to be selected, calls would also be made with the role set to
+ \c Qt::CheckStateRole.
+
+ \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_f
+
+ Various properties of a cell can be adjusted with
+ \l{QAbstractItemModel::flags()}{flags()}. Returning
+ \c Qt::ItemIsEditable | \c Qt::ItemIsEnabled is enough to show an editor
+ that a cell has been selected. If editing one cell modifies more data than
+ the data in that particular cell, the model must emit a
+ \l{QAbstractItemModel::}{dataChanged()} signal in order for the data that
+ has been changed to be read.
+*/
+
+/*!
+ \page modelview-part3.html
+ \contentspage {modelview-index.html}{Model/View Contents}
+ \previouspage {modelview-part2.html}{Developing a Simple Model/View Application}
+ \nextpage {modelview-part4.html}{Good Sources of Additional Information}
+ \title Model/View Chapter 3 - Intermediate Topics
+
+ \section1 3. Intermediate Topics
+
+ \section2 3.1 TreeView
+
+ You can convert the example above into an application with a tree view.
+ Simply replace QTableView with QTreeView, which results in a read/write
+ tree. No changes have to be made to the model. The tree won't have any
+ hierarchies because there aren't any hierarchies in the model itself.
+ \image dummy_tree.png
+
+
+ QListView, QTableView and QTreeView all use a model abstraction, which is a
+ merged list, table and tree. This makes it possible to use several different
+ types of view classes from the same model.
+ \image list_table_tree.png
+
+
+ This is how our example model looks so far:
+ \image example_model.png
+
+
+ We want to present a real tree. We have wrapped our data in the examples
+ above in order to make a model. This time we use QStandardItemModel, which
+ is a container for hierarchical data that also implements
+ QAbstractItemModel. To show a tree, QStandardItemModel must be populated
+ with \l{QStandardItem}{QStandardItems}, which are able to hold all the
+ standard properties of items like text, fonts, checkboxes or brushes.
+ \image tree_2_with_algorithm.png
+
+ \snippet examples/tutorials/modelview/6_treeview/modelview.cpp Quoting ModelView Tutorial
+
+ We simply instantiate a QStandardItemModel and add a couple of
+ \l{QStandardItem}{QStandardItems} to the constructor. We can then make a
+ hierarchical data structure because a QStandardItem can hold other
+ \l{QStandardItem}{QStandardItems}. Nodes are collapsed and expanded within
+ the view.
+
+ \section2 3.2 Working with Selections
+
+ We want to access a selected item's content in order to output it into the
+ window title together with the hierarchy level.
+ \image selection2.png
+
+ So let's create a couple of items:
+
+ \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_a
+
+ Views manage selections within a separate selection model, which can be
+ retrieved with the \l{QAbstractItemView::}{selectionModel()}
+ method. We retrieve the selection Model in order to connect a slot to its
+ \l{QAbstractItemView::}{selectionChanged()} signal.
+
+ \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_b
+
+ We get the model index that corresponds to the selection by calling
+ \l{QItemSelectionModel::currentIndex()}{treeView->selectionModel()->currentIndex()}
+ and we get the the field's string by using the model index. Then we just
+ calculate the item's \c hierarchyLevel. Top level items do not have
+ parents and the \l{QAbstractItemModel::}{parent()} method will return a
+ default constructed \l{QModelIndex}{QModelIndex()}. This is why we use the
+ \l{QAbstractItemModel::}{parent()} method to iterate to the top level while
+ counting the steps performed during iteration.
+
+ The selection model (as shown above) can be retrieved, but it can also be
+ set with \l{QAbstractItemView}{QAbstractItemView::setSelectionModel}. This
+ is how it's possible to have 3 view classes with synchronised selections
+ because only one instance of a selection model is used. The instance of a
+ selection model is retrieved from the first view class with
+ \l{QAbstractItemView::}{selectionModel()} and the result is assigned to the
+ second and third view class with \l{QAbstractItemView::}{setSelectionModel()}.
+
+ \section2 3.3 Predefined Models
+
+ The typical way to use model/view is to wrap specific data to make it
+ usable with view classes. Qt, however, also provides predefined models for
+ common underlying data structures. If one of the available data structures
+ is suitable for your application, a predefined model can be a good choice.
+
+ \table
+ \row
+ \o QStringListModel
+ \o Stores a list of strings
+ \row
+ \o QStandardItemModel
+ \o Stores arbitrary hierarchical items
+ \row
+ \o QFileSystemModel\br
+ QDirModel
+ \o Encapsulate the local file system
+ \row
+ \o QSqlQueryModel
+ \o Encapsulate an SQL result set
+ \row
+ \o QSqlTableModel
+ \o Encapsulates an SQL table
+ \row
+ \o QSqlRelationalTableModel
+ \o Encapsulates an SQL table with foreign keys
+ \row
+ \o QSortFilterProxyModel
+ \o Sorts and/or filters another model
+
+ \endtable
+
+ \section2 3.4 Delegates
+
+ In all examples so far, data is presented as text or a checkbox in a cell
+ and is edited as text or a checkbox. The component that provides these
+ presentation and editing services is called a \e delegate. We are only just
+ beginning to work with the delegate because the view uses a default
+ delegate. But imagine that we want to have a different editor.(e.g. a
+ slider or a drop down list) Or imagine that we want to present data as
+ graphics. Let's take a look at an example called
+ \l{Star Delegate Example}{Star Delegate}, in which stars are used to show
+ a rating:
+ \image stardelegate.png
+
+ The view has a method that replaces the default delegate and installs a
+ custom delegate. This method is called
+ \l{QAbstractItemView::}{setItemDelegate()}. A new delegate can be written
+ by creating a class that inherits from QStyledItemDelegate. In order to
+ write a delegate that displays stars and has no input capabilities, we only
+ need to overwrite 2 methods.
+
+ \code
+ class StarDelegate : public QStyledItemDelegate
+ {
+ Q_OBJECT
+ public:
+ StarDelegate(QWidget *parent = 0);
+ void paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const;
+ QSize sizeHint(const QStyleOptionViewItem &option,
+ const QModelIndex &index) const;
+ };
+ \endcode
+
+ \l{QStyledItemDelegate::}{paint()} draws stars depending on the content
+ of the underlying data. The data can be looked up with parameter
+ \l{QModelIndex::data()}{index.data()}.
+ \l{QAbstractItemDelegate::}{sizeHint()} specifies each star's dimensions
+ so the the cell will provide enough height and width to accommodate the
+ stars.
+
+ Writing custom delegates is the right choice if you want to show your data
+ with a custom graphical representation inside the grid of the view class.
+ If you want to leave the grid, you can write a custom view class.
+
+ \section2 3.5 Debugging with ModelTest
+
+ The passive nature of models provides new challenges for programmers.
+ Inconsistencies in the model can cause the application to crash. Since the
+ model is hit by numerous calls from the view, it is hard to find out which
+ call has crashed the application and which operation has introduced the
+ problem.
+
+ Qt provides software called
+ \l{http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest}{ModelTest},
+ which checks models while your programming is running. Every time the model
+ is changed, ModelTest scans the model and reports errors with an assert.
+ This is especially important for tree models, since their hierarchical
+ nature leaves many possibilities for subtle inconsistencies.
+
+ Unlike view classes, ModelTest uses out of range indexes to test the model.
+ This means your application may crash with ModelTest even if it runs
+ perfectly without it. So you also need to handle all of the indexes that
+ are out of range when using ModelTest.
+
+
+ \section2 3.6 Model/View NG
+
+ \raw HTML
+ <table style="background-color:white;border:none;font: normal 13px/1.2 Verdana;">
+ <tr><td align="left" valign="top" style="background-color:white;border:none;padding:5px;">
+ \endraw
+
+ \raw HTML
+ <!-- wrap content table p has 0 padding and the padding for p outside of the table is 5px-->
+ \endraw
+
+ Model/View was introduced in Qt 4.0 and is a frequently used technology.
+ Feedback from developers and new development trends have shown that there
+ is a need to further develop the model/view technology. Therefore a
+ research project originated at Nokia is looking into ways to go beyond the
+ current implementation.
+
+ One limitation of model/view is that view classes are basically all fixed
+ grids. It is possible, but really hard to make a list view with icons
+ placed on a curve; or cells expanding on mouse over events to show
+ additional information.
+ In order to achieve graphically rich view experiences, Model/View NG will
+ use QGraphicsView to render elements. Nodel/View NG also aims to make
+ model/view programming more intuitive. One way to achieve this is to have
+ separate models for lists, tables and trees. The current model abstraction
+ is complex because it is capable of representing a list, a table or a tree.
+
+ Model/View NG is a research project. You are welcome to checkout the source
+ code, monitor progress and take part in discussions at the following
+ address: \l{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}
+
+ \raw HTML
+ </td><td align="right" valign="top">
+ \endraw
+
+ \inlineimage path.png
+
+ \raw HTML
+ </td></tr></table>
+ \endraw
+*/
+
+/*!
+ \page modelview-part4.html
+ \contentspage {modelview-index.html}{Model/View Contents}
+ \previouspage {modelview-part3.html}{Intermediate Topics}
+ \title Model/View Chapter 4 - Good Sources of Additional Information
+
+ \section1 4. Good Sources of Additional Information
+
+ \section2 4.1 Books
+
+ Model/View programming is covered quite extensively in the documentation of
+ Qt but also in several good books.
+
+ \list 1
+ \o \bold{C++ GUI Programming with Qt 4} / Jasmin Blanchette, Mark Summerfield,
+ \e{Prentice Hall, 2nd edition}, ISBN 0-13-235416-0. Also available in
+ German: C++ GUI Programmierung mit Qt 4: Die offizielle Einführung,
+ \e{Addison-Wesley}, ISBN 3-827327-29-6
+ \o \bold{The Book of Qt4, The Art of Building Qt Applications} / Daniel Molkentin,
+ \e{Open Source Press}, ISBN 1-59327-147-6.
+ Translated from \bold{Qt 4, Einführung in die Applikationsentwicklung},
+ \e{Open Source Press}, ISBN 3-937514-12-0.
+ \o \bold{Foundations of Qt Development} / Johan Thelin, \e{Apress}, ISBN 1-59059-831-8.
+ \endlist
+
+ More information about these books is available on the
+ \l{Books about Qt Programming}{Qt Web site}.
+
+ The following list provides an overview of example programs contained in the
+ books above. Some of them make very good templates for developing similar
+ applications.
+
+ \table
+ \header
+ \o example name
+ \o view class used
+ \o model used
+ \o aspects touched
+ \o
+ \row
+ \o Team Leaders
+ \o QListview
+ \o QStringListModel
+ \o
+ \o Book 1, Chapter 10, Figure 10.6
+ \row
+ \o Directory Viewer
+ \o QTreeView
+ \o QDirModel
+ \o
+ \o Book 1, Chapter 10, Figure 10.7
+ \row
+ \o Color Names
+ \o QListView
+ \o QSortFilterProxyModel
+ applied to QStringListModel
+ \o
+ \o Book 1, Chapter 10, Figure 10.8
+ \row
+ \o Currencies
+ \o QTableView
+ \o custom model based on
+ QAbstractTableModel
+ \o read only
+ \o Book 1, Chapter 10, Figure 10.10
+ \row
+ \o Cities
+ \o QTableView
+ \o custom model based on
+ QAbstractTableModel
+ \o read / write
+ \o Book 1, Chapter 10, Figure 10.12
+ \row
+ \o Boolean Parser
+ \o QTreeView
+ \o custom model based on
+ QAbstractItemModel
+ \o read only
+ \o Book 1, Chapter 10, Figure 10.14
+ \row
+ \o Track Editor
+ \o {2, 1} QTableWidget
+ \o custom delegate providing a custom editor
+ \o Book 1, Chapter 10, Figure 10.15
+
+ \row
+ \o Four directory views
+ \o QListView
+ QTableView
+ QTreeView
+ \o QDirModel
+ \o demonstrates the use of multiple views
+ \o Book2, Chapter 8.2
+ \row
+ \o Address Book
+ \o QListView
+ QTableView
+ QTreeView
+ \o custom model based on
+ QAbstractTableModel
+ \o read / write
+ \o Book2, Chapter 8.4
+ \row
+ \o Address Book with sorting
+ \o
+ \o QProxyModel
+ \o introducing sort and filter capabilities
+ \o Book2, Chapter 8.5
+ \row
+ \o Address Book
+ with checkboxes
+ \o
+ \o
+ \o introducing checkboxes in model/view
+ \o Book2, Chapter 8.6
+ \row
+ \o Address Book with transposed grid
+ \o
+ \o custom proxy Model based on QAbstractProxyModel
+ \o introducing a custom model
+ \o Book2, Chapter 8.7
+ \row
+ \o Address Book with drag and drop
+ \o
+ \o
+ \o introducing drag and drop support
+ \o Book2, Chapter 8.8
+ \row
+ \o Address Book with custom editor
+ \o
+ \o
+ \o introducing custom delegates
+ \o Book2, Chapter 8.9
+ \row
+ \o Views
+ \o QListView
+ QTableView
+ QTreeView
+ \o QStandardItemModel
+ \o read only
+ \o Book 3, Chapter 5, figure 5-3
+ \row
+ \o Bardelegate
+ \o QTableView
+ \o
+ \o custom delegate for presentation based on QAbstractItemDelegate
+ \o Book 3, Chapter 5, figure 5-5
+ \row
+ \o Editdelegate
+ \o QTableView
+ \o
+ \o custom delegate for editing based on QAbstractItemDelegate
+ \o Book 3, Chapter 5, figure 5-6
+ \row
+ \o Singleitemview
+ \o custom view based on QAbstractItemView
+ \o
+ \o custom view
+ \o Book 3,
+ Chapter 5,
+ figure 5-7
+ \row
+ \o listmodel
+ \o QTableView
+ \o custom Model based on QAbstractTableModel
+ \o read only
+ \o Book 3, Chapter 5, Figure 5-8
+ \row
+ \o treemodel
+ \o QTreeView
+ \o custom Model based on QAbstractItemModel
+ \o read only
+ \o Book 3, Chapter 5, Figure 5-10
+ \row
+ \o edit integers
+ \o QListView
+ \o custom Model based on QAbstractListModel
+ \o read / write
+ \o Book 3, Chapter 5, Listing 5-37, Figure 5-11
+ \row
+ \o sorting
+ \o QTableView
+ \o QSortFilterProxyModel applied to QStringListModel
+ \o demonstrates sorting
+ \o Book 3, Chapter 5, Figure 5-12
+ \endtable
+
+
+ \section2 4.2 Qt Documentation
+
+ Qt 4.7 comes with 17 examples and 2 Demonstrations for model/view.
+ The examples can be found here: \l{Item Views Examples}
+ \table
+ \header
+ \o Example name
+ \o View class used
+ \o Model used
+ \o Aspects touched
+ \row
+ \o Address Book
+ \o QTableView
+ \o QAbstractTableModel
+ QSortFilterProxyModel
+ \o usage of QSortFilterProxyModel to generate different
+ subsets from one data pool
+ \row
+ \o Basic Sort/Filter Model
+ \o QTreeView
+ \o QStandardItemModel
+ QSortFilterProxyModel
+ \o
+ \row
+ \o Chart
+ \o custom view
+ \o QStandardItemModel
+ \o designing custom views that cooperate with selection models
+ \row
+ \o Color Editor Factory
+ \o {2, 1} QTableWidget
+ \o enhancing the standard delegate with a new custom editor to choose colours
+ \row
+ \o Combo Widget Mapper
+ \o QDataWidgetMapper to map QLineEdit, QTextEdit and QComboBox
+ \o QStandardItemModel
+ \o shows how a QComboBox can serve as a view class
+ \row
+ \o Custom Sort/Filter Model
+ \o QTreeView
+ \o QStandardItemModel
+ QSortFilterProxyModel
+ \o subclass QSortFilterProxyModel for advanced sorting and filtering
+ \row
+ \o Dir View
+ \o QTreeView
+ \o QDirModel
+ \o very small example to demonstrate how to assign a model to a view
+ \row
+ \o Editable Tree Model
+ \o QTreeView
+ \o custom tree model
+ \o comprehensive example for working with trees, demonstrates
+ editing cells and tree structure with an underlying custom
+ model
+ \row
+ \o Fetch More
+ \o QListView
+ \o custom list model
+ \o dynamically changing model
+ \row
+ \o Frozen Column
+ \o QTableView
+ \o QStandardItemModel
+ \o
+ \row
+ \o Pixelator
+ \o QTableView
+ \o custom table model
+ \o implementation of a custom delegate
+ \row
+ \o Puzzle
+ \o QListView
+ \o custom list model
+ \o model/view with drag and drop
+ \row
+ \o Simple DOM Model
+ \o QTreeView
+ \o custom tree model
+ \o read only example for a custom tree model
+ \row
+ \o Simple Tree Model
+ \o QTreeView
+ \o custom tree model
+ \o read only example for a custom tree model
+ \row
+ \o Simple Widget Mapper
+ \o QDataWidgetMapper to map QLineEdit, QTextEdit and QSpinBox
+ \o QStandardItemModel
+ \o basic QDataWidgetMapper usage
+ \row
+ \o Spin Box Delegate
+ \o QTableView
+ \o QStandardItemModel
+ \o custom delegate that uses a spin box as a cell editor
+ \row
+ \o Star Delegate
+ \o {2, 1} QTableWidget
+ \o comprehensive custom delegate example.
+ \endtable
+
+ \l{Qt Demonstrations}{Demonstrations} are similar to examples except
+ that no walkthrough is provided for the code. Demonstrations are also
+ sometimes more feature rich.
+
+ \list
+ \o The \bold Interview demonstration shows the same model and
+ selection being shared between three different views.
+ \o Demonstration \bold Spreadsheet demonstrates the use of a
+ table view as a spreadsheet, using custom delegates to render
+ each item according to the type of data it contains.
+ \endlist
+
+ A \l{Model/View Programming}{reference document} for model/view technology
+ is also available.
+*/
diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc
index aa4a933..798a7a1 100644
--- a/doc/src/widgets-and-layouts/layout.qdoc
+++ b/doc/src/widgets-and-layouts/layout.qdoc
@@ -242,7 +242,7 @@
For further guidance when implementing these functions, see the
\e{Qt Quarterly} article
- \l{http://qt.nokia.com/doc/qq/qq04-height-for-width.html}
+ \l{http://doc.qt.nokia.com/qq/qq04-height-for-width.html}
{Trading Height for Width}.