aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-05 09:01:22 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-05 09:31:34 +0200
commit2795ac5d5930fa28ea329529c0dd2e515b361531 (patch)
tree8dd01197f5b71e1eb8e3612b0119764623325803 /src/quick/doc
parent8f93d3627a9b76bf77896501129990e33a77f32c (diff)
parent6ff0e9a65657e8c51a37e63efe8169bb7e3050cc (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgrenderloop.cpp Change-Id: Idd7106995b5545fcac869e9056a365ef9edb36ca
Diffstat (limited to 'src/quick/doc')
-rw-r--r--src/quick/doc/snippets/qml/loader/KeyReader.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/focus.qml7
-rw-r--r--src/quick/doc/src/advtutorial.qdoc34
-rw-r--r--src/quick/doc/src/concepts/layouts/qtquicklayouts-index.qdoc2
-rw-r--r--src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc4
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc4
-rw-r--r--src/quick/doc/src/concepts/statesanimations/animations.qdoc2
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc6
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc2
-rw-r--r--src/quick/doc/src/tutorial.qdoc4
10 files changed, 35 insertions, 32 deletions
diff --git a/src/quick/doc/snippets/qml/loader/KeyReader.qml b/src/quick/doc/snippets/qml/loader/KeyReader.qml
index 41eb208dd0..56604319e0 100644
--- a/src/quick/doc/snippets/qml/loader/KeyReader.qml
+++ b/src/quick/doc/snippets/qml/loader/KeyReader.qml
@@ -43,7 +43,7 @@ Item {
Item {
focus: true
Keys.onPressed: {
- console.log("Loaded item captured:",
+ console.log("KeyReader captured:",
event.text);
event.accepted = true;
}
diff --git a/src/quick/doc/snippets/qml/loader/focus.qml b/src/quick/doc/snippets/qml/loader/focus.qml
index 5634a48ad1..f3509021f1 100644
--- a/src/quick/doc/snippets/qml/loader/focus.qml
+++ b/src/quick/doc/snippets/qml/loader/focus.qml
@@ -49,11 +49,14 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onClicked: loader.source = "KeyReader.qml"
+ onClicked: {
+ loader.source = "KeyReader.qml"
+ }
}
Keys.onPressed: {
- console.log("Captured:", event.text);
+ console.log("Captured:",
+ event.text);
}
}
//![0]
diff --git a/src/quick/doc/src/advtutorial.qdoc b/src/quick/doc/src/advtutorial.qdoc
index 6aeabbd7b5..025f902a6b 100644
--- a/src/quick/doc/src/advtutorial.qdoc
+++ b/src/quick/doc/src/advtutorial.qdoc
@@ -70,7 +70,7 @@ directory.
\example tutorials/samegame/samegame1
-\section2 Creating the application screen
+\section2 Creating the Application Screen
The first step is to create the basic QML items in your application.
@@ -92,7 +92,7 @@ and is used to give the button a more native look-and-feel.
Notice the anchors for the \c Item, \c Button and \c Text types are set using
group (dot) notation for readability.
-\section2 Adding \c Button and \c Block components
+\section2 Adding \c Button and \c Block Components
The \c Button item in the code above is defined in a separate component file named \c Button.qml.
To create a functional button, we use the QML types \l Text and \l MouseArea inside a \l Rectangle.
@@ -138,7 +138,7 @@ types to get started. Next, we will populate the game canvas with some blocks.
\example tutorials/samegame/samegame2
-\section2 Generating the blocks in JavaScript
+\section2 Generating the Blocks in JavaScript
Now that we've written some types, let's start writing the game.
@@ -181,7 +181,7 @@ and moves the new block to its position on the game canvas. This involves severa
\endlist
-\section2 Connecting JavaScript components to QML
+\section2 Connecting JavaScript Components to QML
Now we need to call the JavaScript code in \c samegame.js from our QML files.
To do this, we add this line to \c samegame.qml which imports
@@ -212,7 +212,7 @@ Now, we have a screen of blocks, and we can begin to add the game mechanics.
\example tutorials/samegame/samegame3
-\section2 Making a playable game
+\section2 Making a Playable Game
Now that we have all the game components, we can add the game logic that
dictates how a player interacts with the blocks and plays the game
@@ -230,7 +230,7 @@ To do this, we have added the following functions to \c samegame.js:
As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML types. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to QML.
-\section3 Enabling mouse click interaction
+\section3 Enabling Mouse Click Interaction
To make it easier for the JavaScript code to interface with the QML types, we have added an Item called \c gameCanvas to \c samegame.qml. It replaces the background as the item which contains the blocks. It also accepts mouse input from the user. Here is the item code:
@@ -248,7 +248,7 @@ When clicked, the \l MouseArea calls \c{handleClick()} in \c samegame.js, which
Note that if \c score was a global variable in the \c{samegame.js} file you would not be able to bind to it. You can only bind to QML properties.
-\section3 Updating the score
+\section3 Updating the Score
When the player clicks a block and triggers \c handleClick(), \c handleClick() also calls \c victoryCheck() to update the score and to check whether the player has completed the game. Here is the \c victoryCheck() code:
@@ -267,14 +267,14 @@ And this is how it is used in the main \c samegame.qml file:
We give the dialog a \l {Item::z}{z} value of 100 to ensure it is displayed on top of our other components. The default \c z value for an item is 0.
-\section3 A dash of color
+\section3 A Dash of Color
It's not much fun to play Same Game if all the blocks are the same color, so we've modified the \c createBlock() function in \c samegame.js to randomly create a different type of block (for either red, green or blue) each time it is called. \c Block.qml has also changed so that each block contains a different image depending on its type:
\snippet tutorials/samegame/samegame3/Block.qml 0
-\section2 A working game
+\section2 A Working Game
Now we now have a working game! The blocks can be clicked, the player can score, and the game can end (and then you can start a new one).
Here is a screenshot of what has been accomplished so far:
@@ -298,7 +298,7 @@ until the next chapter - where your application becomes alive!
\example tutorials/samegame/samegame4
-\section2 Adding some flair
+\section2 Adding Some Flair
Now we're going to do two things to liven up the game: animate the blocks and add a High Score system.
@@ -307,7 +307,7 @@ JavaScript and QML files outside of \c samegame.qml have been moved into a new s
In anticipation of the new block animations, \c Block.qml file is now renamed to \c BoomBlock.qml.
-\section3 Animating block movement
+\section3 Animating Block Movement
First we will animate the blocks so that they move in a fluid manner. QML has a number of methods for adding fluid
movement, and in this case we're going to use the \l Behavior type to add a \l SpringAnimation.
@@ -324,7 +324,7 @@ This ensures the \l SpringAnimation on the \c x is only enabled after \c createB
the correct position. Otherwise, the blocks will slide out of the corner (0,0) when a game begins, instead of falling
from the top in rows. (Try commenting out \c {enabled: spawned} and see for yourself.)
-\section3 Animating block opacity changes
+\section3 Animating Block Opacity Changes
Next, we will add a smooth exit animation. For this, we'll use a \l Behavior type, which allows us to specify
a default animation when a property change occurs. In this case, when the \c opacity of a Block changes, we will
@@ -353,7 +353,7 @@ Initially, we add these States to the root type of \c{BoomBlock.qml}:
Now blocks will automatically fade in, as we already set \c spawned to true when we implemented the block animations.
To fade out, we set \c dying to true instead of setting opacity to 0 when a block is destroyed (in the \c floodFill() function).
-\section3 Adding particle effects
+\section3 Adding Particle Effects
Finally, we'll add a cool-looking particle effect to the blocks when they are destroyed. To do this, we first add a \l ParticleSystem in
\c BoomBlock.qml, like so:
@@ -374,7 +374,7 @@ player's actions. The end result is shown below, with a different set of images
The theme change here is produced simply by replacing the block images. This can be done at runtime by changing the \l Image \c source property, so for a further challenge, you could add a button that toggles between themes with different images.
-\section2 Keeping a High Scores table
+\section2 Keeping a High Scores Table
Another feature we might want to add to the game is a method of storing and retrieving high scores.
@@ -409,7 +409,7 @@ The \c nameInputDialog is activated in the \c victoryCheck() function in \c same
\dots 4
\snippet tutorials/samegame/samegame4/content/samegame.js 4
-\section3 Storing high scores offline
+\section3 Storing High Scores Offline
Now we need to implement the functionality to actually save the High Scores table.
@@ -423,7 +423,7 @@ Then, we use the \l{QtQuick.LocalStorage}{Local Storage API} to maintain a persi
This is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the \c Dialog). This would allow a more themeable dialog that could better present the high scores. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database.
-\section3 Storing high scores online
+\section3 Storing High Scores Online
You've seen how you can store high scores locally, but it is also easy to integrate a web-enabled high score storage into your QML application. The implementation we've done her is very
simple: the high score data is posted to a php script running on a server somewhere, and that server then stores it and
@@ -445,7 +445,7 @@ An alternate way to access and submit web-based data would be to use QML types d
makes it very easy to fetch and display XML based data such as RSS in a QML application (see the Flickr demo for an example).
-\section2 That's it!
+\section2 That's It!
By following this tutorial you've seen how you can write a fully functional application in QML:
diff --git a/src/quick/doc/src/concepts/layouts/qtquicklayouts-index.qdoc b/src/quick/doc/src/concepts/layouts/qtquicklayouts-index.qdoc
index 0be66fad2c..f65b1152e9 100644
--- a/src/quick/doc/src/concepts/layouts/qtquicklayouts-index.qdoc
+++ b/src/quick/doc/src/concepts/layouts/qtquicklayouts-index.qdoc
@@ -43,7 +43,7 @@
\annotatedlist layouts
- \section1 Related information
+ \section1 Related Information
\list
\li \l{Qt Quick}
diff --git a/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc b/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc
index e5834eb5c8..05e4465f2a 100644
--- a/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc
+++ b/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc
@@ -33,7 +33,7 @@
Qt Quick Layouts are items that are used to arrange items in a user interface. Since Qt Quick
Layouts also resize their items, they are well suited for resizable user interfaces.
- \section1 Getting started
+ \section1 Getting Started
The QML types can be imported into your application using the following import statement in your \c {.qml} file.
@@ -152,7 +152,7 @@
height specified in the QML file.
- \section1 Connecting windows and layouts
+ \section1 Connecting Windows and Layouts
You can just use normal anchoring concepts to ensure that the layout will follow the window
resizing.
diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
index 12a107491a..8c647a5eaa 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
@@ -75,7 +75,7 @@ The API works just like with \l QStringList, as shown in the previous section.
have changed. If the QVariantList changes, it will be necessary to reset
the model.
-\section2 QObjectList-based model
+\section2 QObjectList-based Model
A list of QObject* values can also be used as a model. A QList<QObject*> provides
the properties of the objects in the list as roles.
@@ -112,7 +112,7 @@ has changed. If the QList changes, it is necessary to reset
the model by calling QQmlContext::setContextProperty() again.
-\section2 QAbstractItemModel subclass
+\section2 QAbstractItemModel Subclass
A model can be defined by subclassing QAbstractItemModel. This is the
best approach if you have a more complex model that cannot be supported
diff --git a/src/quick/doc/src/concepts/statesanimations/animations.qdoc b/src/quick/doc/src/concepts/statesanimations/animations.qdoc
index 1a2cff43f4..146902ecf1 100644
--- a/src/quick/doc/src/concepts/statesanimations/animations.qdoc
+++ b/src/quick/doc/src/concepts/statesanimations/animations.qdoc
@@ -139,7 +139,7 @@ values.
\target qml-transition-animations
-\section2 Transitions during State Changes
+\section2 Transitions During State Changes
\l{State}{Qt Quick States} are property configurations where a property may have different values to reflect different states. State changes introduce
abrupt property changes; animations smooth transitions to produce visually
diff --git a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
index bcfdf311af..ba5b97da39 100644
--- a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
@@ -35,7 +35,7 @@ Originally Qt Quick always relied on OpenGL (OpenGL ES 2.0 or OpenGL 2.0) for pa
the scene graph and rendering the results to a render target. From Qt 5.8 onwards
Qt Quick also supports rendering in software and with Direct3D 12.
-\section1 Switching between the adaptation used by the application
+\section1 Switching Between the Adaptation Used by the Application
The default rendering backend is still OpenGL, or - in Qt builds with disabled OpenGL support -
the software renderer. This can be overridden either by using an environment variable
@@ -261,7 +261,7 @@ offscreen render targets will be created with the specified sample count and a
quality of the maximum supported quality level. The backend automatically
performs resolving into the non-multisample swapchain buffers after each frame.
-\section2 Semi-transparent windows
+\section2 Semi-transparent Windows
When the alpha channel is enabled either via
QQuickWindow::setDefaultAlphaBuffer() or by setting alphaBufferSize to a
@@ -286,7 +286,7 @@ power-of-two images at the moment. Textures of other size will work too, but
this involves a QImage-based scaling on the CPU first. Therefore avoid enabling
mipmapping for NPOT images whenever possible.
-\section2 Image formats
+\section2 Image Formats
When creating textures via the C++ scenegraph APIs like
QQuickWindow::createTextureFromImage(), 32-bit formats will not involve any
diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
index cb14c72b04..a7666d725e 100644
--- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
@@ -540,7 +540,7 @@ with multiple windows.
and may trigger early-z when available, but again, setting
Item::visible to false is always faster.
- \section2 Mixing with 3D primitives
+ \section2 Mixing with 3D Primitives
The scene graph can support pseudo 3D and proper 3D primitives. For
instance, one can implement a "page curl" effect using a
diff --git a/src/quick/doc/src/tutorial.qdoc b/src/quick/doc/src/tutorial.qdoc
index e44129de83..6084a8a686 100644
--- a/src/quick/doc/src/tutorial.qdoc
+++ b/src/quick/doc/src/tutorial.qdoc
@@ -99,7 +99,7 @@ In this case, we specify that our text type should be horizontally centered in t
The \c font.pointSize and \c font.bold properties are related to fonts and use the dot notation.
-\section2 Viewing the example
+\section2 Viewing the Example
To view what you have created, run the \l{Prototyping with qmlscene}{qmlscene} tool (located in the \c bin directory) with your filename as the first argument.
For example, to run the provided completed Tutorial 1 example from the install location, you would type:
@@ -167,7 +167,7 @@ the same size as its parent.
A \l MouseArea defines a signal called \e clicked.
When this signal is triggered we want to emit our own \e clicked signal with the color as parameter.
-\section2 The main QML file
+\section2 The Main QML File
In our main QML file, we use our \c Cell component to create the color picker: