aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/doc')
-rw-r--r--src/quick/doc/images/visualize-batches.pngbin0 -> 666 bytes
-rw-r--r--src/quick/doc/images/visualize-clip.pngbin0 -> 9201 bytes
-rw-r--r--src/quick/doc/images/visualize-original.pngbin0 -> 4151 bytes
-rw-r--r--src/quick/doc/images/visualize-overdraw-1.pngbin0 -> 6872 bytes
-rw-r--r--src/quick/doc/images/visualize-overdraw-2.pngbin0 -> 5386 bytes
-rw-r--r--src/quick/doc/qtquick.qdocconf1
-rw-r--r--src/quick/doc/snippets/qml/xmlrole.qml9
-rw-r--r--src/quick/doc/snippets/qml/xmlrole.xml20
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc117
-rw-r--r--src/quick/doc/src/dynamicview-tutorial.qdoc4
-rw-r--r--src/quick/doc/src/examples.qdoc18
-rw-r--r--src/quick/doc/src/tutorial.qdoc4
-rw-r--r--src/quick/doc/src/whatsnew.qdoc9
13 files changed, 161 insertions, 21 deletions
diff --git a/src/quick/doc/images/visualize-batches.png b/src/quick/doc/images/visualize-batches.png
new file mode 100644
index 0000000000..eb6ebe3606
--- /dev/null
+++ b/src/quick/doc/images/visualize-batches.png
Binary files differ
diff --git a/src/quick/doc/images/visualize-clip.png b/src/quick/doc/images/visualize-clip.png
new file mode 100644
index 0000000000..0a67b308cc
--- /dev/null
+++ b/src/quick/doc/images/visualize-clip.png
Binary files differ
diff --git a/src/quick/doc/images/visualize-original.png b/src/quick/doc/images/visualize-original.png
new file mode 100644
index 0000000000..00a2de2e4b
--- /dev/null
+++ b/src/quick/doc/images/visualize-original.png
Binary files differ
diff --git a/src/quick/doc/images/visualize-overdraw-1.png b/src/quick/doc/images/visualize-overdraw-1.png
new file mode 100644
index 0000000000..af2cf098d7
--- /dev/null
+++ b/src/quick/doc/images/visualize-overdraw-1.png
Binary files differ
diff --git a/src/quick/doc/images/visualize-overdraw-2.png b/src/quick/doc/images/visualize-overdraw-2.png
new file mode 100644
index 0000000000..6872074808
--- /dev/null
+++ b/src/quick/doc/images/visualize-overdraw-2.png
Binary files differ
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index 515263f079..edad14cfd4 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -44,7 +44,6 @@ sourcedirs += .. \
../../quickwidgets
exampledirs += ../../../examples/quick \
- ../../../examples/quickwidgets \
snippets
diff --git a/src/quick/doc/snippets/qml/xmlrole.qml b/src/quick/doc/snippets/qml/xmlrole.qml
index 0f75135da2..257594179a 100644
--- a/src/quick/doc/snippets/qml/xmlrole.qml
+++ b/src/quick/doc/snippets/qml/xmlrole.qml
@@ -52,7 +52,7 @@ XmlListModel {
//![1]
// XmlRole queries will be made on <book> elements
- query: "/catalogue/book"
+ query: "/catalog/book"
// query the book title
XmlRole { name: "title"; query: "title/string()" }
@@ -65,17 +65,22 @@ XmlListModel {
// query the book's first listed author (note in XPath the first index is 1, not 0)
XmlRole { name: "first_author"; query: "author[1]/string()" }
+
+ // query the wanted attribute as a boolean
+ XmlRole { name: "wanted"; query: "boolean(@wanted)" }
}
//![1]
+//![2]
ListView {
width: 300; height: 200
model: model
delegate: Column {
- Text { text: title + " (" + type + ")"; font.bold: true }
+ Text { text: title + " (" + type + ")"; font.bold: wanted }
Text { text: first_author }
Text { text: year }
}
+//![2]
}
}
diff --git a/src/quick/doc/snippets/qml/xmlrole.xml b/src/quick/doc/snippets/qml/xmlrole.xml
new file mode 100644
index 0000000000..70280e067d
--- /dev/null
+++ b/src/quick/doc/snippets/qml/xmlrole.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<catalog>
+ <book type="Online" wanted="true">
+ <title>Qt 5 Cadaques</title>
+ <year>2014</year>
+ <author>Juergen Bocklage-Ryannel</author>
+ <author>Johan Thelin</author>
+ </book>
+ <book type="Hardcover">
+ <title>C++ GUI Programming with Qt 4</title>
+ <year>2006</year>
+ <author>Jasmin Blanchette</author>
+ <author>Mark Summerfield</author>
+ </book>
+ <book type="Paperback">
+ <title>Programming with Qt</title>
+ <year>2002</year>
+ <author>Matthias Kalle Dalheimer</author>
+ </book>
+ </catalog>
diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
index 278733de8d..7a54b7a021 100644
--- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
@@ -739,4 +739,121 @@ with multiple windows.
{QSG_RENDER_TIMING=1} will output a number of useful timing
parameters which can be useful in pinpointing where a problem lies.
+ \section1 Visualizing
+
+ To visualize the various aspects of the scene graph's default renderer, the
+ \c QSG_VISUALIZE environment variable can be set to one of the values
+ detailed in each section below. We provide examples of the output of
+ some of the variables using the following QML code:
+
+ \code
+ import QtQuick 2.2
+
+ Rectangle {
+ width: 200
+ height: 140
+
+ ListView {
+ id: clippedList
+ x: 20
+ y: 20
+ width: 70
+ height: 100
+ clip: true
+ model: ["Item A", "Item B", "Item C", "Item D"]
+
+ delegate: Rectangle {
+ color: "lightblue"
+ width: parent.width
+ height: 25
+
+ Text {
+ text: modelData
+ anchors.fill: parent
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ ListView {
+ id: clippedDelegateList
+ x: clippedList.x + clippedList.width + 20
+ y: 20
+ width: 70
+ height: 100
+ clip: true
+ model: ["Item A", "Item B", "Item C", "Item D"]
+
+ delegate: Rectangle {
+ color: "lightblue"
+ width: parent.width
+ height: 25
+ clip: true
+
+ Text {
+ text: modelData
+ anchors.fill: parent
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+ }
+ \endcode
+
+ For the ListView on the left, we set its \l {Item::clip}{clip} property to
+ \c true. For the ListView on right, we also set each delegate's
+ \l {Item::clip}{clip} property to \c true to illustrate the effects of
+ clipping on batching.
+
+ \image visualize-original.png "Original"
+ Original
+
+ \note The visualized elements do not respect clipping, and rendering order is
+ arbitrary.
+
+ \section2 Visualizing Batches
+
+ Setting \c QSG_VISUALIZE to \c batches visualizes batches in the renderer.
+ Merged batches are drawn with a solid color and unmerged batches are drawn
+ with a diagonal line pattern. Few unique colors means good batching.
+ Unmerged batches are bad if they contain many individual nodes.
+
+ \image visualize-batches.png "batches"
+ \c QSG_VISUALIZE=batches
+
+ \section2 Visualizing Clipping
+
+ Setting \c QSG_VISUALIZE to \c clip draws red areas on top of the scene
+ to indicate clipping. As Qt Quick Items do not clip by default, no clipping
+ is usually visualized.
+
+ \image visualize-clip.png
+ \c QSG_VISUALIZE=clip
+
+ \section2 Visualizing Changes
+
+ Setting \c QSG_VISUALIZE to \c changes visualizes changes in the renderer.
+ Changes in the scenegraph are visualized with a flashing overlay of a random
+ color. Changes on a primitive are visualized with a solid color, while
+ changes in an ancestor, such as matrix or opacity changes, are visualized
+ with a pattern.
+
+ \section2 Visualizing Overdraw
+
+ Setting \c QSG_VISUALIZE to \c overdraw visualizes overdraw in the renderer.
+ Visualize all items in 3D to highlight overdraws. This mode can also be used
+ to detect geometry outside the viewport to some extent. Opaque items are
+ rendered with a green tint, while translucent items are rendered with a red
+ tint. The bounding box for the viewport is rendered in blue. Opaque content
+ is easier for the scenegraph to process and is usually faster to render.
+
+ Note that the root rectangle in the code above is superfluous as the window
+ is also white, so drawing the rectangle is a waste of resources in this case.
+ Changing it to an Item can give a slight performance boost.
+
+ \image visualize-overdraw-1.png "overdraw-1"
+ \image visualize-overdraw-2.png "overdraw-2"
+ \c QSG_VISUALIZE=overdraw
*/
diff --git a/src/quick/doc/src/dynamicview-tutorial.qdoc b/src/quick/doc/src/dynamicview-tutorial.qdoc
index 2f07b7b234..cf1115cf4a 100644
--- a/src/quick/doc/src/dynamicview-tutorial.qdoc
+++ b/src/quick/doc/src/dynamicview-tutorial.qdoc
@@ -109,8 +109,8 @@ the view and cannot be moved by other means.
Dragging the content item is enabled by binding it to the MouseArea's
\l {QtQuick::MouseArea::drag.target}{drag.target} property. Because we still want the view to be
-flickable we wait until the MouseArea's \l {QtQuick::MouseArea::onPressAndHold}{onPressAndHold}
-handler is triggered before binding the drag target. This way when mouse moves before the hold
+flickable we wait until the MouseArea's \l {QtQuick::MouseArea::}{pressAndHold}
+signal is emitted before binding the drag target. This way when mouse moves before the hold
timeout has expired it is interpreted as moving the list and if it moves after it is interpreted as
dragging an item. To make it more obvious to the user when an item can be dragged we'll change the
background color of the content item when the timeout has expired.
diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc
index def50ecd60..22c9786fda 100644
--- a/src/quick/doc/src/examples.qdoc
+++ b/src/quick/doc/src/examples.qdoc
@@ -74,7 +74,7 @@ steps such as use cases and introductory material. For more information about Qt
\div {class="landingicons"}
\div {class="icons1of3"}
- \bold{Development Environment}
+ \b{Development Environment}
\list
\li \l{Qt Creator: Creating Qt Quick Projects}{Creating Qt Quick Projects}
\li \l{Qt Creator: Using Qt Quick Designer}{Using Qt Quick Designer}
@@ -85,7 +85,7 @@ steps such as use cases and introductory material. For more information about Qt
\endlist
\enddiv
\div {class="icons1of3"}
- \bold{Beginning with QML and Qt Quick}
+ \b{Beginning with QML and Qt Quick}
\list
\li \l{First Steps with QML}
\li \l{Getting Started Programming with Qt Quick}{Qt Quick Text Editor}
@@ -93,7 +93,7 @@ steps such as use cases and introductory material. For more information about Qt
\endlist
\enddiv
\div {class="icons1of3"}
- \bold{Use Cases}
+ \b{Use Cases}
\list
\li \l{qtquick-usecase-visual.html}{Visual types in QML}
\li \l{qtquick-usecase-userinput.html}{Responding to User Input in QML}
@@ -124,7 +124,7 @@ the examples from within Qt Creator.
\div {class="landingicons"}
\div {class="icons1of3"}
- \bold{QML Types and Controls}
+ \b{QML Types and Controls}
\list
\li \l{Qt Quick Controls - Gallery}{Controls Gallery}
\li \l{Qt Quick System Dialog Examples}{Dialog Examples}
@@ -135,7 +135,7 @@ the examples from within Qt Creator.
\endlist
\enddiv
\div {class="icons1of3"}
- \bold{Layouts and Views}
+ \b{Layouts and Views}
\list
\li \l{Qt Quick Controls - Basic Layouts Example}{Basic Layouts}
\li \l{Qt Quick Examples - Positioners}{Positioners}
@@ -145,7 +145,7 @@ the examples from within Qt Creator.
\endlist
\enddiv
\div {class="icons1of3"}
- \bold{Image and Graphics}
+ \b{Image and Graphics}
\list
\li \l{Qt Quick Examples - Image Elements}{Image Elements}
\li \l{Qt Quick Examples - Animation}{Animation}
@@ -157,7 +157,7 @@ the examples from within Qt Creator.
\div {class="landingicons"}
\div {class="icons1of3"}
- \bold{Keyboard, Focus, and Touch}
+ \b{Keyboard, Focus, and Touch}
\list
\li \l{Qt Quick Examples - Key Interaction}{Key Interaction}
\li \l{Qt Quick Examples - MouseArea}{MouseArea}
@@ -165,7 +165,7 @@ the examples from within Qt Creator.
\endlist
\enddiv
\div {class="icons1of3"}
- \bold{System and Events}
+ \b{System and Events}
\list
\li \l{Qt Quick Examples - Threading}{Threading}
\li \l{Qt Quick Examples - Accessibility}{Accessibility}
@@ -174,7 +174,7 @@ the examples from within Qt Creator.
\endlist
\enddiv
\div {class="icons1of3"}
- \bold{Scene Graph}
+ \b{Scene Graph}
\list
\li \l{Scene Graph - OpenGL Under QML}{OpenGL Under QML}
\li \l{Scene Graph - Painted Item}{Painted Item}
diff --git a/src/quick/doc/src/tutorial.qdoc b/src/quick/doc/src/tutorial.qdoc
index e0c05b16a8..75ca1b8d55 100644
--- a/src/quick/doc/src/tutorial.qdoc
+++ b/src/quick/doc/src/tutorial.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
@@ -31,7 +31,7 @@
\brief An introduction to the basic concepts and features of QML.
\nextpage QML Tutorial 1 - Basic Types
-This tutorial gives an introduction to QML, the declarative language for Qt Quick. It doesn't cover everything;
+This tutorial gives an introduction to QML, the language for Qt Quick UIs. It doesn't cover everything;
the emphasis is on teaching the key principles, and features are introduced as needed.
Through the different steps of this tutorial we will learn about QML basic types, we will create our own QML component
diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc
index f50e80edf6..ca2a2156d8 100644
--- a/src/quick/doc/src/whatsnew.qdoc
+++ b/src/quick/doc/src/whatsnew.qdoc
@@ -53,7 +53,6 @@ features introduced by the new import and new classes in Qt 5.1:
\endlist
These types are kept due to compatibility reasons and are replaced by the
\l{Qt QML Models QML Types}{Qt QML Models} types.
- \endlist
\endlist
\section2 New Submodules
@@ -216,7 +215,7 @@ relative to its start.
\list
\li \c Text.RightElide is now supported where text spans multiple lines.
\li New \l{Text::}{linkColor} property controls the color of linked text.
- \li New \l{Text::}{onLineLaidOut} handler is called for every line during the layout process to
+ \li New \l{Text::}{lineLaidOut} signal is emitted for every line during the layout process to
give the option of positioning and/or resizing lines as they are laid out.
\li New \l{Text::}{doLayout()} method will trigger the text layout from Javascript.
\li New \l{Text::}{fontSizeMode} property allows text to be fitted to the item size.
@@ -250,9 +249,9 @@ the window loses focus.
\list
\li Wheel events are now supported; events are provided through the new WheelEvent type.
\li New \l{MouseArea::}{propagateComposedEvents} property sets whether composed events are
- propagated to other mouse areas. If this property is true and the l{MouseArea::onClicked}{clicked},
- \l{MouseArea::onDoubleClicked}{doubleClicked} or \l{MouseArea::onPressAndHold}{pressAndHold}
- handlers reject a mouse event, the event will be propagated to overlapping MouseArea items
+ propagated to other mouse areas. If this property is true and the handlers of the
+ \l{MouseArea::}{clicked}, \l{MouseArea::}{doubleClicked} or \l{MouseArea::}{pressAndHold}
+ signals reject a mouse event, the event will be propagated to overlapping MouseArea items
in the same area that are lower in the stacking order.
\li New \l{MouseArea::}{cursorShape} property controls the cursor shape.
\endlist