forked from qt-creator/qt-creator
Doc: Remove Model Editor docs
Task-number: QDS-13221 Change-Id: I4b24e5344c71e0eebe48c9deb5a3c5214cd77f01 Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io> Reviewed-by: Ali Kianian <ali.kianian@qt.io>
This commit is contained in:
@@ -120,7 +120,6 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a>Data</a>
|
<li><a>Data</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="quick-json-data-properties.html">Connecting Properties to JSON Data Source</a></li>
|
|
||||||
<li><a href="studio-model-editor.html">Data Models</a></li>
|
<li><a href="studio-model-editor.html">Data Models</a></li>
|
||||||
<li><a href="quick-data-models.html">Lists and Other Data Models</a></li>
|
<li><a href="quick-data-models.html">Lists and Other Data Models</a></li>
|
||||||
<li><a href="qtquick-placeholder-data.html">Loading Placeholder Data</a></li>
|
<li><a href="qtquick-placeholder-data.html">Loading Placeholder Data</a></li>
|
||||||
@@ -442,7 +441,6 @@
|
|||||||
<li><a href="qtquick-effect-composer-view.html">Effect Composer</a></li>
|
<li><a href="qtquick-effect-composer-view.html">Effect Composer</a></li>
|
||||||
<li><a href="creator-file-system-view.html">File System</a></li>
|
<li><a href="creator-file-system-view.html">File System</a></li>
|
||||||
<li><a href="studio-material-editor.html">Material Editor and Browser</a></li>
|
<li><a href="studio-material-editor.html">Material Editor and Browser</a></li>
|
||||||
<li><a href="studio-model-editor.html">Model Editor</a></li>
|
|
||||||
<li><a href="qtquick-navigator.html">Navigator</a></li>
|
<li><a href="qtquick-navigator.html">Navigator</a></li>
|
||||||
<li><a href="creator-open-documents-view.html">Open Documents</a></li>
|
<li><a href="creator-open-documents-view.html">Open Documents</a></li>
|
||||||
<li><a href="creator-projects-view.html">Projects</a></li>
|
<li><a href="creator-projects-view.html">Projects</a></li>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 10 KiB |
BIN
doc/qtdesignstudio/images/studio-edit-list-model.webp
Normal file
BIN
doc/qtdesignstudio/images/studio-edit-list-model.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2021 The Qt Company Ltd.
|
// Copyright (C) 2024 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -147,12 +147,12 @@
|
|||||||
\uicontrol {Default Components} > \uicontrol Views to the
|
\uicontrol {Default Components} > \uicontrol Views to the
|
||||||
\uicontrol Navigator or \uicontrol {2D} view.
|
\uicontrol Navigator or \uicontrol {2D} view.
|
||||||
\li Right-click the view in \uicontrol Navigator, and select
|
\li Right-click the view in \uicontrol Navigator, and select
|
||||||
\uicontrol {Edit Model} in the context-menu to open the
|
\uicontrol {Edit List Model} in the context-menu to open
|
||||||
\uicontrol {Model Editor} view.
|
the list model editor.
|
||||||
\image edit-list-model-model-editor.webp "List view in Model Editor"
|
\image studio-edit-list-model.webp "List view in the list model editor"
|
||||||
\li Double-click a cell to edit its value.
|
\li Double-click the column headings and cells to change their values.
|
||||||
\li Use the toolbar buttons to add or remove rows and columns.
|
\li Use the toolbar buttons to add, remove, or move rows and columns.
|
||||||
In a list, each column represents a property, and each row adds a
|
In a list, each column represents a property and each row adds a
|
||||||
list item.
|
list item.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
\li \l{Effect Composer}
|
\li \l{Effect Composer}
|
||||||
\li \l{File System}
|
\li \l{File System}
|
||||||
\li \l{Material Editor and Browser}
|
\li \l{Material Editor and Browser}
|
||||||
\li \l{Model Editor}
|
|
||||||
\li \l{Navigator}
|
\li \l{Navigator}
|
||||||
\li \l{Open Documents}
|
\li \l{Open Documents}
|
||||||
\li \l{Projects}
|
\li \l{Projects}
|
||||||
@@ -134,7 +133,6 @@
|
|||||||
\li\l{Connecting Components to Signals}
|
\li\l{Connecting Components to Signals}
|
||||||
\li\l{Adding Bindings Between Properties}
|
\li\l{Adding Bindings Between Properties}
|
||||||
\li\l{Specifying Custom Properties}
|
\li\l{Specifying Custom Properties}
|
||||||
\li\l{Connecting Properties to JSON Data Source}
|
|
||||||
\endlist
|
\endlist
|
||||||
\li \l{Working with States}
|
\li \l{Working with States}
|
||||||
\endlist
|
\endlist
|
||||||
|
@@ -96,44 +96,75 @@
|
|||||||
\endlist
|
\endlist
|
||||||
\image repeater3d-numeric-model.webp
|
\image repeater3d-numeric-model.webp
|
||||||
|
|
||||||
\section1 Adding a Repeater3D Component with a Model
|
\section1 Adding a Repeater3D Component with a List Model
|
||||||
|
|
||||||
This section explains how to add a \uicontrol Repeater3D component with
|
This section explains how to add a \uicontrol Repeater3D component with
|
||||||
a model to your \QDS project:
|
a list model to your \QDS project:
|
||||||
|
|
||||||
To add a \uicontrol Repeater3D component:
|
To add a \uicontrol Repeater3D component:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Drag a \uicontrol Repeater3D component from \uicontrol Components to
|
\li Drag a \uicontrol Repeater3D component from \uicontrol Components to
|
||||||
\e scene in \uicontrol Navigator.
|
\e scene in \uicontrol Navigator.
|
||||||
\li Go to \uicontrol {Model Editor} and create a new model with the name
|
\li You need to enter the QML code for the \uicontrol ListModel manually.
|
||||||
\e planetModel.
|
Go to the \uicontrol {Code} view and enter the following code somewhere
|
||||||
\li Add the following columns and data to the model.
|
inside the root object:
|
||||||
\raw HTML
|
\code qml
|
||||||
<table>
|
ListModel {
|
||||||
<tr>
|
id: planetModel
|
||||||
<th>name (<i>String</i>)</th>
|
ListElement {
|
||||||
<th>radius (<i>Real</i>)</th>
|
name: "Mars"
|
||||||
</tr>
|
radius: 3.39
|
||||||
<tr>
|
}
|
||||||
<td>Mars</td>
|
ListElement {
|
||||||
<td>3.39</td>
|
name: "Earth"
|
||||||
</tr>
|
radius: 6.37
|
||||||
<tr>
|
}
|
||||||
<td>Earth</td>
|
ListElement {
|
||||||
<td>6.37</td>
|
name: "Venus"
|
||||||
</tr>
|
radius: 6.05
|
||||||
<tr>
|
}
|
||||||
<td>Venus</td>
|
}
|
||||||
<td>6.05</td>
|
\endcode
|
||||||
</tr>
|
The default root object for a \QDS project is \uicontrol Rectangle, so
|
||||||
</table>
|
you can paste the \uicontrol ListModel code, for example, like this:
|
||||||
\endraw
|
\code qml
|
||||||
\note You can also import a model in JSON or CSV format. See \l {Importing a Data Model}.
|
Rectangle {
|
||||||
\image repeater3d-model-editor.webp
|
width: Constants.width
|
||||||
\li In \uicontrol Navigator, select \e{_3DRepeater}.
|
height: Constants.height
|
||||||
\li In \uicontrol Properties, set \uicontrol Model to \e {DataStore.planetModel}.
|
color: Constants.backgroundColor
|
||||||
|
|
||||||
|
ListModel {
|
||||||
|
id: planetModel
|
||||||
|
ListElement {
|
||||||
|
name: "Mars"
|
||||||
|
radius: 3.39
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
name: "Earth"
|
||||||
|
radius: 6.37
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
name: "Venus"
|
||||||
|
radius: 6.05
|
||||||
|
}
|
||||||
|
}
|
||||||
|
View3D {
|
||||||
|
id: view3D
|
||||||
|
anchors.fill: parent
|
||||||
|
...
|
||||||
|
\endcode
|
||||||
|
\li In the \uicontrol {Code} view, add \c {model: planetModel} to the
|
||||||
|
\uicontrol Repeater3D object to tell that you want to use your
|
||||||
|
\uicontrol ListModel as the model for the \uicontrol Repeater3D object.
|
||||||
\endlist
|
\endlist
|
||||||
|
\code qml
|
||||||
|
Repeater3D {
|
||||||
|
id: repeater3D
|
||||||
|
model: planetModel
|
||||||
|
}
|
||||||
|
\endcode
|
||||||
|
|
||||||
Now, you have set up the \uicontrol Repeater3D component to use a
|
Now, you have set up the \uicontrol Repeater3D component to use a
|
||||||
\uicontrol ListModel to draw the items. Next, you need to add the
|
\uicontrol ListModel to draw the items. Next, you need to add the
|
||||||
item to draw. In this example, you are using a \uicontrol Sphere.
|
item to draw. In this example, you are using a \uicontrol Sphere.
|
||||||
@@ -147,7 +178,7 @@
|
|||||||
next to \uicontrol Scale > \uicontrol X.
|
next to \uicontrol Scale > \uicontrol X.
|
||||||
\li Select \uicontrol {Set binding} to open \uicontrol {Binding Editor}.
|
\li Select \uicontrol {Set binding} to open \uicontrol {Binding Editor}.
|
||||||
\li In the binding editor, enter \c{radius}. This sets the X
|
\li In the binding editor, enter \c{radius}. This sets the X
|
||||||
scale to the radius value defined in the model for each of the sphere
|
scale to the radius value defined in the list model for each of the sphere
|
||||||
instances.
|
instances.
|
||||||
\image repeater3d-radius-binding.png
|
\image repeater3d-radius-binding.png
|
||||||
\li Select \uicontrol OK.
|
\li Select \uicontrol OK.
|
||||||
@@ -170,6 +201,6 @@
|
|||||||
result. You need to zoom out to see all the spheres.
|
result. You need to zoom out to see all the spheres.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\image repeater3d-list-model.webp
|
\image repeater3d-list-model.webp "Spheres in Repeater3D with a ListModel"
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@@ -1,63 +0,0 @@
|
|||||||
// Copyright (C) 2024 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\page quick-json-data-properties.html
|
|
||||||
\previouspage quick-dynamic-properties.html
|
|
||||||
\nextpage quick-states.html
|
|
||||||
|
|
||||||
\title Connecting Properties to JSON Data Source
|
|
||||||
|
|
||||||
Connect properties to data from a JSON file. You need two files in your project to do this:
|
|
||||||
|
|
||||||
\table
|
|
||||||
\row
|
|
||||||
\li \c {data.json}
|
|
||||||
\li A data file.
|
|
||||||
\row
|
|
||||||
\li \c {JsonData.qml}
|
|
||||||
\li A singleton that reads data from \c {data.json}.
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
To create these files, you need to create a new data model:
|
|
||||||
|
|
||||||
\list 1
|
|
||||||
\li In \uicontrol {Model Editor}, select \inlineimage {icons/zoomIn.png}.
|
|
||||||
\li Select \uicontrol{Create}.
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
The files are created in the \e {/imports/<projectName>/} folder of the project.
|
|
||||||
|
|
||||||
\section1 Connecting a Text Property to a Data Source
|
|
||||||
|
|
||||||
To connect a text property to a corresponding field in a JSON file:
|
|
||||||
|
|
||||||
\list 1
|
|
||||||
\li In the \uicontrol Navigator or \uicontrol 2D view, select a component
|
|
||||||
that has a text property, for example, a text field.
|
|
||||||
\li In the \uicontrol Connections view, go to the \uicontrol Bindings
|
|
||||||
tab.
|
|
||||||
\li Select \inlineimage {icons/plus.png}.
|
|
||||||
\li In the first \uicontrol From field, select \uicontrol {DataStore}, and in the second field,
|
|
||||||
select the JSON entry you want to use. In this example, \uicontrol {backend.name} is
|
|
||||||
selected. This corresponds to the \e name entry in \c {data.json}.
|
|
||||||
\li In the \uicontrol To field, ensure that \uicontrol text is selected.
|
|
||||||
\image json-text-binding.webp
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
Now, the text field is populated with data from the JSON file.
|
|
||||||
|
|
||||||
\section1 Adding Data Fields to the JSON File
|
|
||||||
|
|
||||||
If you add data fields to the JSON file, you need to manually do the same
|
|
||||||
updates to \c {JsonData.qml}.
|
|
||||||
|
|
||||||
\list 1
|
|
||||||
\li Go to the \uicontrol Projects view and open \c {JsonData.qml}.
|
|
||||||
\image project-jasondata.webp
|
|
||||||
\li In the \uicontrol Properties view, create a new local custom property.
|
|
||||||
\image json-new-property.webp
|
|
||||||
\li Ensure that the name of the property matches the data entry in the JSON file.
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
*/
|
|
@@ -32,11 +32,6 @@
|
|||||||
can specify values for. You can add custom properties that would
|
can specify values for. You can add custom properties that would
|
||||||
not otherwise exist for a particular \l{Component Types}
|
not otherwise exist for a particular \l{Component Types}
|
||||||
{component type} or your custom components.
|
{component type} or your custom components.
|
||||||
|
|
||||||
\li \l{Connecting Properties to JSON Data Source}
|
|
||||||
|
|
||||||
You can add bindings between properties and data from a JSON file.
|
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
For an example of using properties, bindings, and connections to create a
|
For an example of using properties, bindings, and connections to create a
|
||||||
|
@@ -1,62 +0,0 @@
|
|||||||
// Copyright (C) 2024 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\page studio-model-editor.html
|
|
||||||
\previouspage qtquick-effect-composer-view.html
|
|
||||||
\nextpage creator-project-managing-workspaces.html
|
|
||||||
|
|
||||||
\ingroup studio-views
|
|
||||||
|
|
||||||
\title Model Editor
|
|
||||||
|
|
||||||
\brief Create, manage, import, and export data models.
|
|
||||||
|
|
||||||
In the \uicontrol {Model Editor} view, you can create, manage, import, and export
|
|
||||||
data models. With data models, you can, for example, populate views with data.
|
|
||||||
|
|
||||||
\image edit-list-model-model-editor.webp
|
|
||||||
|
|
||||||
For examples of how to use data models, see
|
|
||||||
\l {Adding a Repeater3D Component with a Model}.
|
|
||||||
|
|
||||||
\section1 Creating a Data Model
|
|
||||||
|
|
||||||
To create a data model:
|
|
||||||
\list 1
|
|
||||||
\li In \uicontrol {Model Editor}, select \inlineimage {icons/zoomIn.png}.
|
|
||||||
\li Enter a name and select \uicontrol {Create}.
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
This creates a single-cell table.
|
|
||||||
|
|
||||||
\image model-editor-new-model.webp
|
|
||||||
|
|
||||||
Next, add columns, rows, and data to the model.
|
|
||||||
|
|
||||||
\note You must manually save the table after you have made changes. To do this,
|
|
||||||
select \inlineimage {icons/save-effect-composer.png}.
|
|
||||||
|
|
||||||
\section1 Editing a Data Model
|
|
||||||
|
|
||||||
Edit a data model in one of the following ways:
|
|
||||||
\list
|
|
||||||
\li Right-click a column name to edit its name and type, delete, or sort it.
|
|
||||||
\li Double-click a cell to edit its content.
|
|
||||||
\li Use the toolbar to add and remove columns and rows.
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
\note You must manually save the table after you have made changes. To do this,
|
|
||||||
select \inlineimage {icons/save-effect-composer.png}.
|
|
||||||
|
|
||||||
\section1 Importing a Data Model
|
|
||||||
|
|
||||||
Import data models from JSON or CSV files. To do this, select \inlineimage {icons/import.png}
|
|
||||||
in \uicontrol {Model Editor}.
|
|
||||||
|
|
||||||
\section1 Exporting a Data Model
|
|
||||||
|
|
||||||
Export data models to JSON or CSV files. To do this, select \inlineimage {icons/export.png}
|
|
||||||
in \uicontrol {Model Editor}.
|
|
||||||
|
|
||||||
*/
|
|
Reference in New Issue
Block a user