diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-24 10:14:57 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-02-24 11:48:14 +0100 |
commit | b1fa22c1683d9f6cedb001f5ef8a0dac71868935 (patch) | |
tree | c30a114c75be071310df974283b928329f9d5c12 /src/quick/doc | |
parent | ba68c325688acf3072715757480497524f61c425 (diff) | |
parent | fe5d69669197a51662061b014810f0242eec5ca7 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
src/qml/compiler/qv4ssa.cpp
src/quick/accessible/qaccessiblequickview_p.h
src/quick/items/qquickmousearea.cpp
src/quick/util/qquickanimatorjob.cpp
tools/qmlplugindump/main.cpp
Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
Diffstat (limited to 'src/quick/doc')
6 files changed, 100 insertions, 18 deletions
diff --git a/src/quick/doc/snippets/qml/localstorage/hello.qml b/src/quick/doc/snippets/qml/localstorage/hello.qml new file mode 100644 index 0000000000..959895c82a --- /dev/null +++ b/src/quick/doc/snippets/qml/localstorage/hello.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples 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 The Qt Company Ltd 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 QtQuick 2.0 + +Rectangle { + color: "white" + width: 200 + height: 100 + + Text { + text: "?" + anchors.horizontalCenter: parent.horizontalCenter + function findGreetings() { + var db = openDatabaseSync("QDeclarativeExampleDB", "1.0", "The Example QML SQL!", 1000000); + + db.transaction( + function(tx) { + // Create the database if it doesn't already exist + tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)'); + + // Add (another) greeting row + tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); + + // Show all added greetings + var rs = tx.executeSql('SELECT * FROM Greeting'); + + var r = "" + for (var i = 0; i < rs.rows.length; i++) { + r += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + "\n" + } + text = r + } + ) + } + Component.onCompleted: findGreetings() + } +} +//![0] diff --git a/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc b/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc index 20a6d131f5..e5834eb5c8 100644 --- a/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc +++ b/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc @@ -64,7 +64,7 @@ In addition to the above features, GridLayout adds these features: \list \li \l{Layout::row}{Grid coordinates} can be specified with the \l{Layout::row}{Layout.row} and - \l{Layout::column}{Layout.column}. + \l{Layout::column}{Layout.column} properties. \li \l{GridLayout::flow}{Automatic grid coordinates} used together with the \l{GridLayout::flow}{flow}, \l{GridLayout::rows}{rows}, and \l{GridLayout::columns}{columns} properties. diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc index a764402c2f..12a107491a 100644 --- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc +++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc @@ -36,10 +36,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 \l QStringList, a QObjectList or a -\l QAbstractItemModel. The first two are useful for exposing simpler datasets, -while QAbstractItemModel provides a more flexible solution for more complex -models. +A C++ model class can be defined as a \l QStringList, a \l QVariantList, a +QObjectList or a \l QAbstractItemModel. The first three are useful for exposing +simpler datasets, while QAbstractItemModel provides a more flexible solution for +more complex models. \section2 QStringList-based Model @@ -60,10 +60,20 @@ The complete source code for this example is available in \l {models/stringlistmodel}{examples/quick/models/stringlistmodel} within the Qt install directory. -\b{Note:} There is no way for the view to know that the contents of a QStringList -have changed. If the QStringList changes, it will be necessary to reset +\note There is no way for the view to know that the contents of a QStringList +have changed. If the QStringList changes, it will be necessary to reset the model by calling QQmlContext::setContextProperty() again. +\section2 QVariantList-based Model + +A model may be a single \l QVariantList, which provides the contents of the list +via the \e modelData role. + +The API works just like with \l QStringList, as shown in the previous section. + +\note There is no way for the view to know that the contents of a QVariantList +have changed. If the QVariantList changes, it will be necessary to reset +the model. \section2 QObjectList-based model diff --git a/src/quick/doc/src/concepts/positioning/topic.qdoc b/src/quick/doc/src/concepts/positioning/topic.qdoc index 92113ece54..b28acd1f89 100644 --- a/src/quick/doc/src/concepts/positioning/topic.qdoc +++ b/src/quick/doc/src/concepts/positioning/topic.qdoc @@ -112,7 +112,7 @@ them, and where possible, pristine Anchor layouts should be preferred. \section1 Anchors -Anchors allows an item to be placed either adjacent to or inside of another, +Anchors allow an item to be placed either adjacent to or inside of another, by attaching one or more of the item's anchor-points (boundaries) to an anchor-point of the other. These anchors will remain even if the dimensions or location of one of the items changes, allowing for highly dynamic diff --git a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc index 3fd92177f9..d80c72e0f1 100644 --- a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc @@ -31,18 +31,14 @@ \section1 Scene Graph Adaptations in Qt Quick -Originally Qt Quick only had one available renderer for parsing the scene graph -and rendering the results to a render target. This renderer is now the default -OpenGL Renderer which supports rendering either using the OpenGL ES 2.0 or -OpenGL 2.0 (with framebuffer object extensions) APIs. The Qt Quick APIs have -originally been designed with the assumption that OpenGL is always available. -However, it is now possible to use other graphics API's to render Qt Quick -scenes using the scene graph APIs. +Originally Qt Quick always relied on OpenGL (OpenGL ES 2.0 or OpenGL 2.0) for parsing +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 -The default of the OpenGL, or - in Qt builds with disabled OpenGL support - the -software adaptation, can be overridden either by using an environment variable +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 or a C++ API. The former consists of setting the \c{QT_QUICK_BACKEND} or the legacy \c{QMLSCENE_DEVICE} environment variable before launching applications. The latter is done by calling QQuickWindow::setSceneGraphBackend() early in the diff --git a/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc b/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc index fd5bf51307..f971043b58 100644 --- a/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc @@ -125,7 +125,7 @@ the blue rectangle and beneath any of the blue rectangle's children. Stacking order can be influenced with the \l Item::z property. Z values below 0 will stack below the parent, and if z values are assigned then siblings will stack in z-order (with creation order used to break ties). Z values only affect -stacking compared to siblings and the parent item. If you have an item who is obscured by a subtree rooted above its +stacking compared to siblings and the parent item. If you have an item which is obscured by a subtree rooted above its parent item, no z value on that item will increase its stacking order to stack above that subtree. To stack that item above the other subtree you'll have to alter z values farther up in the hierarchy, or re-arrange the visual item hierarchy. |