aboutsummaryrefslogtreecommitdiffstats
path: root/doc/qtcreator
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@qt.io>2024-03-26 13:40:44 +0100
committerLeena Miettinen <riitta-leena.miettinen@qt.io>2024-04-08 08:00:11 +0000
commitc25c54d454f06a7998707d8604b5fecf034874f5 (patch)
tree4e7b474d1f8cea17b0eaca470642fa333caa9142 /doc/qtcreator
parent5b870f101ed90105d6f0966227835c01c579c9e4 (diff)
Doc: Update info about using Qt Quick modules with plugins
- Some steps are not needed when developing with Qt 6.2 or later. - Removed obsolete information. Task-number: QDS-11794 Change-Id: Ifbfc0bacd50557892ac82658379098123f463a2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'doc/qtcreator')
-rw-r--r--doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc55
1 files changed, 28 insertions, 27 deletions
diff --git a/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc b/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc
index abaf7cca35..9f0f661d4f 100644
--- a/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-modules-with-plugins.qdoc
@@ -36,22 +36,25 @@
\list 1
\li Create custom components and place all the \c .qml files in a
- directory dedicated to your module. For example:
+ directory dedicated to your module. For example,
\c {imports\asset_imports}.
- \li For Qt Quick UI Prototype projects (.qmlproject), specify the path to
+ \if defined(qtcreator)
+ \li For Qt Quick UI Prototype projects (.qmlproject), specify the path to
the directory that has the module in the .qmlproject file
of the application where you want to use the module
- as a value of the \c importPaths variable. For example
+ as a value of the \c importPaths variable. For example,
\c{importPaths: [ "imports", "asset_imports" ]}.
-
+ \else
+ \li Specify the path to the directory that has the module in the
+ .qmlproject file of the application where you want to use the module
+ as a value of the \c importPaths variable. For example,
+ \c{importPaths: [ "imports", "asset_imports" ]}.
+ \endif
\li Create a \c qmldir file for your module and place it
in the module directory. For more information, see
\l {Module Definition qmldir Files}.
- \li Create a \c qmltypes file, as instructed in
- \l {Generating Type Description Files}.
-
\li Create a directory named \c designer in your module directory.
\li Create a \c .metainfo file for your module and place it in the
@@ -66,23 +69,29 @@
\if defined(qtcreator)
\li Import the module into the project, as instructed in
\l {Importing QML Modules}.
- \endlist
-
- \note If \QC cannot find the new QML module, build the project
- and then go to \uicontrol {Tools} > \uicontrol {QML/JS} >
- \uicontrol {Reset Code Model} to reset the code model.
-
\else
\li Build your module using the same Qt version and compiler as \QDS.
- For more information, see \l {Running QML Modules in Design Mode}.
+
+ Your module and components should now appear in \uicontrol Components.
+ \endif
+
\endlist
- Your module should now appear in \uicontrol Components. Your components
- should appear in a subsection of \uicontrol Components if a valid
- \c .metainfo file is in place.
+ \note If \QC cannot find the new QML module, build the project
+ and then go to \uicontrol {Tools} > \uicontrol {QML/JS} >
+ \uicontrol {Reset Code Model} to reset the code model.
+ \if defined(qtdesignstudio)
+ For more information about how to show the \uicontrol {Tools} menu, see
+ \l{Customizing the Menu}.
\endif
- \section1 Generating Type Description Files
+ \if defined(qtcreator)
+ \section1 Developing with Qt 6.1 or Earlier
+
+ Since Qt 6.2, CMake generates the \c qmltypes and \c qmldir files
+ automatically.
+
+ \section2 Generating Type Description Files
When \l{Defining QML Types from C++}{registering QML types}, make sure that
the QML module has a \c{plugins.qmltypes} file. Ideally, it should be located
@@ -115,6 +124,7 @@
\endcode
The import path affects all the targets built by the CMake project.
+ \endif
\if defined(qtdesignstudio)
\section1 Running QML Modules in Design Mode
@@ -138,15 +148,6 @@
in the \uicontrol Design mode. You can use the value of the \c QML_PUPPET_MODE
environment variable to check whether the plugin is currently being run
by an application or edited in the \uicontrol Design mode.
-
- If you want to use a different module in the \uicontrol Design mode
- than in your actual application for example to mockup C++ items,
- you can use \c{QML_DESIGNER_IMPORT_PATH}
- in the \c{.pro} file (for qmake projects), or declare and set the property
- \c qmlDesignerImportPaths in your product (for Qbs projects).
- Modules in the import paths defined in \c{QML_DESIGNER_IMPORT_PATH} will be
- used only in the \uicontrol Design mode.
- For an example, see \l {Qt Quick Controls - Contact List}.
\endif
\sa {Resetting the Code Model}