Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtquickcontrols-deployment.qdoc
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page qtquickcontrols-deployment.html
6 \title Deploying Qt Quick Controls Applications
7
8 Deployment of Qt Quick Controls applications is very similar to
9 deployment of other types of Qt applications. However, there are a few
10 factors to consider.
11
12 \section1 Deploying an Application with Several Styles
13
14 Suppose you have an application that will be deployed to both Android and
15 Windows devices. To ensure that only the minimum set of files that are
16 necessary for the application to run are deployed to each device, you can
17 use file selectors. For example, your directory structure could look like
18 this:
19
20 \code
21 resources.qrc
22 main.qml
23 +windows/MyPage.qml
24 +windows/qtquickcontrols2.conf
25 +android/MyPage.qml
26 +android/qtquickcontrols2.conf
27 \endcode
28
29 In the project above, \c main.qml would import \c QtQuick.Controls, for
30 example, but shouldn't import, say, \c QtQuick.Controls.Material. Any code
31 that is style-specific is moved out into separate files; just as we've done
32 for \c MyPage.qml.
33
34 The \c +windows/qtquickcontrols2.conf file would contain configuration
35 options specific to the Universal style:
36
37 \code
38 [Controls]
39 Style=Universal
40
41 [Universal]
42 Theme=Dark
43 Accent=Red
44 \endcode
45
46 The \c +android/qtquickcontrols2.conf file would contain configuration
47 options specific to the Material style:
48
49 \code
50 [Controls]
51 Style=Material
52
53 [Material]
54 Theme=Light
55 Accent=Brown
56 \endcode
57
58 \section1 Static Builds
59
60 For dynamically built applications, it is not necessary to import a
61 specific style that should be usable by that application. For statically
62 built applications, Qt's build system must be involved to ensure that
63 QML plugins function as expected. Specifically, \c qmake uses
64 \c qmlimportscanner to scan the QML files in your application for import
65 statements. For this reason, any styles that should be usable by a
66 statically built application must explicitly import that style. Where the
67 import occurs is up to the developer, but it is recommended to follow the
68 approach mentioned in the \l {Deploying an Application with Several Styles}
69 section, so that only the minimum set of files that are necessary for a
70 particular device are deployed.
71
72 \sa {Deploying Qt Applications}, {Using Styles in Qt Quick Controls}
73*/