path: root/doc
diff options
authorMitch Curtis <mitch.curtis@qt.io>2018-10-02 13:44:56 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-10-04 08:30:12 +0000
commitbb27df0890e22979706455bd756e33d2bdf17240 (patch)
tree4e8cdbb137720b23ed8a754a2ac5f783fd7dcd40 /doc
parentf4efe2a29b8f87402811ab29b673350090c6a4b4 (diff)
Document how to add QML files to a project
Task-number: QBS-1390 Change-Id: Id339d9d2041ca035607ee970e421c21f40424987 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'doc')
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/howtos.qdoc b/doc/howtos.qdoc
index 7982ae6d4..f793c773e 100644
--- a/doc/howtos.qdoc
+++ b/doc/howtos.qdoc
@@ -45,6 +45,7 @@
\li \l{How do I apply C/C++ preprocessor macros to only a subset of the files in my product?}
\li \l{How do I make the state of my Git repository available to my source files?}
\li \l{How do I limit the number of concurrent jobs for the linker only?}
+ \li \l{How do I add QML files to a project?}
\section1 How do I build a Qt-based project?
@@ -415,4 +416,27 @@
Job limits set on the command line override those from the settings, which in turn
override the ones defined within a project. Use the \c{--enforce-project-job-limits}
option to give the job limits defined via \c JobLimit items maximum precedence.
+ \section1 How do I add QML files to a project?
+ The simplest way to add QML files to a project is to add them to a
+ \l {The Qt Resource System}{resource file}:
+ \code
+ QtGuiApplication {
+ // ...
+ files: "main.cpp"
+ Group {
+ prefix: "qml/"
+ files: ["main.qml", "HomePage.qml"]
+ fileTags: ["qml", "qt.core.resource_data"]
+ }
+ }
+ \endcode
+ In the example above, we declare each QML file as having the
+ \l {filetags-qtcore}{"qt.core.resource_data"} file tag. This ensures
+ that it is added to a generated resource file.