aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@qt.io>2020-09-29 09:13:07 +0200
committerLeena Miettinen <riitta-leena.miettinen@qt.io>2020-09-29 09:10:25 +0000
commitcb8ee308eef0c6ae6539b9f5b53971867ca163f0 (patch)
tree8ab01af167d9489d1b09d738d72ec241bf147fc8 /doc
parent3ca4544869531830805fc2080bffda39f805fcb9 (diff)
Doc: Create separate topic for dummy QML data
There is now a collection topic for methods for simulating data in the Qt Design Studio Manual. Move information about creating dummy QML models there. Change-Id: Id15998b172169a7d714250350f6f627b998ad9e8 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'doc')
-rw-r--r--doc/qtcreator/src/qtcreator-toc.qdoc1
-rw-r--r--doc/qtcreator/src/qtquick/qtquick-annotations.qdoc4
-rw-r--r--doc/qtcreator/src/qtquick/qtquick-properties.qdoc88
-rw-r--r--doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc4
-rw-r--r--doc/qtcreator/src/qtquick/qtquick-uis.qdoc9
-rw-r--r--doc/qtdesignstudio/src/qtdesignstudio-javascript.qdoc2
-rw-r--r--doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc8
-rw-r--r--doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc1
8 files changed, 27 insertions, 90 deletions
diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc
index debfa4cda1..6f647cbf81 100644
--- a/doc/qtcreator/src/qtcreator-toc.qdoc
+++ b/doc/qtcreator/src/qtcreator-toc.qdoc
@@ -104,6 +104,7 @@
\li \l{Specifying Item Properties}
\li \l{Using Custom Fonts}
\li \l{Annotating Designs}
+ \li \l{Loading Placeholder Data}
\li \l{Qt Quick UI Forms}
\endlist
\li \l {Adding Dynamics}
diff --git a/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc b/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc
index 415a99e10e..526cc001f9 100644
--- a/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc
@@ -26,7 +26,11 @@
/*!
\page qtquick-annotations.html
\previouspage qtquick-fonts.html
+ \if defined(qtdesignstudio)
\nextpage creator-quick-ui-forms.html
+ \else
+ \nextpage qtquick-placeholder-data.html
+ \endif
\title Annotating Designs
diff --git a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc
index b356ac9633..be23396b5b 100644
--- a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc
@@ -203,94 +203,6 @@
You can add other languages later by editing the project file.
\endif
- \section1 Loading Placeholder Data
-
- The Design mode supports views, models, and delegates, so that when you add
- a Grid View, List View, or Path View item, the ListModel and the delegate
- item are added automatically.
-
- However, the missing context of the application presents a challenge.
- Specific models defined in C++ are the most obvious case. Often,
- the context is missing simple properties, which are either defined in C++,
- or in other QML files. A typical example is an item that uses the
- properties of its parent, such as \c parent.width.
-
- \section2 Using Dummy Models
-
- If you open a file in the Design mode that references a C++ model, you see
- nothing on
- the canvas. If the data in the model is fetched from the internet, you have
- no control over it. To get reliable data, \e {dummy data} was introduced.
-
- For example, the following code snippet describes the file example.qml that
- contains a ListView that in turn specifies a C++ model:
-
- \qml
- ListView {
- model: dataModel
- delegate: ContactDelegate {
- name: name
- }
- }
- \endqml
-
- Create a directory named \e dummydata in the root directory of the project,
- so that it is not deployed to the device. In the \c dummydata directory,
- create a QML file that has the same name as the value of \c model:
-
- \code
- qml/exampleapp/example.qml
- dummydata/dataModel.qml
- \endcode
-
- Then create the dataModel.qml file that contains the dummy data:
-
- \qml
- import QtQuick 2.0
-
- ListModel {
- ListElement {
- name: "Ariane"
- }
- ListElement {
- name: "Bella"
- }
- ListElement {
- name: "Corinna"
- }
- }
- \endqml
-
- \section2 Creating Dummy Context
-
- The following example presents a common pattern in QML:
-
- \qml
- Item {
- width: parent.width
- height: parent.height
- }
- \endqml
-
- This works nicely for applications but the Design mode displays a zero-sized
- item. A parent for the opened file does not exist, because the context is
- missing. To get around the missing context, the idea of a \e {dummy
- context} is introduced. If you place a file with the same name as the
- application (here, example.qml) in the \c {dummydata/context} directory,
- you can fake a parent context:
-
- \qml
- import QtQuick 2.0
- import QmlDesigner 1.0
-
- DummyContextObject {
- parent: Item {
- width: 640
- height: 300
- }
- }
- \endqml
-
\section1 Building Transformations on Items
The \uicontrol Advanced tab allows you to configure advanced
diff --git a/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc b/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc
index 3d243c9571..b069337304 100644
--- a/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc
@@ -31,7 +31,11 @@
/*!
\page creator-quick-ui-forms.html
+ \if defined(qtdesignstudio)
\previouspage qtquick-annotations.html
+ \else
+ \previouspage qtquick-placeholder-data.html
+ \endif
\nextpage qtquick-adding-dynamics.html
\title Qt Quick UI Forms
diff --git a/doc/qtcreator/src/qtquick/qtquick-uis.qdoc b/doc/qtcreator/src/qtquick/qtquick-uis.qdoc
index 3905fb06e6..74bc891d71 100644
--- a/doc/qtcreator/src/qtquick/qtquick-uis.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-uis.qdoc
@@ -101,6 +101,15 @@
You can annotate your designs to provide reviewers or developers
with additional information about them.
+ \if defined(qtcreator)
+ \li \l {Loading Placeholder Data}
+
+ You can create QML files that contain placeholder data, so that
+ you can test grid, list, or path views, even though you don't
+ have access to real data.
+
+ \endif
+
\if defined(qtdesignstudio)
\endlist
diff --git a/doc/qtdesignstudio/src/qtdesignstudio-javascript.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-javascript.qdoc
index 869a4aadb6..b2eaade9fd 100644
--- a/doc/qtdesignstudio/src/qtdesignstudio-javascript.qdoc
+++ b/doc/qtdesignstudio/src/qtdesignstudio-javascript.qdoc
@@ -24,7 +24,7 @@
****************************************************************************/
/*!
- \previouspage studio-simulation-overview.html
+ \previouspage qtquick-placeholder-data.html
\page studio-javascript.html
\nextpage studio-simulink.html
diff --git a/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc
index 810e3e6f37..109b40d37e 100644
--- a/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc
+++ b/doc/qtdesignstudio/src/qtdesignstudio-simulation-overview.qdoc
@@ -26,7 +26,7 @@
/*!
\page studio-simulation-overview.html
\previouspage creator-editor-options-text.html
- \nextpage studio-javascript.html
+ \nextpage qtquick-placeholder-data.html
\title Simulating Data Input
@@ -37,6 +37,12 @@
Simulink simulation.
\list
+ \li \l{Loading Placeholder Data}
+
+ You can create QML files that contain placeholder data, so that
+ you can test grid, list, or path views, even though you don't
+ have access to real data.
+
\li \l{Simulating Application Logic}
You can use JavaScript to generate mock data for your UI.
diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc
index 4b3b7f2798..ee143fc714 100644
--- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc
+++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc
@@ -159,6 +159,7 @@
\endlist
\li \l{Simulating Data Input}
\list
+ \li \l{Loading Placeholder Data}
\li \l{Simulating Application Logic}
\li \l{Simulating Dynamic Systems}
\endlist