aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/cmake/policy/qtp0001.qdoc
blob: a4e54ed1aea58750a3f2b2bdfdffa779a69d235e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qt-cmake-policy-qtp0001.html
\ingroup qt-cmake-policies

\title QTP0001
\keyword qt_cmake_policy_qtp0001

\summary {':/qt/qml/' is the default resource prefix for QML modules.}

This policy was introduced in Qt 6.5. It changes where
\l{qt_add_qml_module}{qt_add_qml_module()} stores QML resources in
the resource system.

Enabling this policy ensures that your QML module is placed under
a default \l {QML Import Path}{import path}, and its types can be
found without manual calls to \l QQmlEngine::addImportPath.

The \c OLD behavior of this policy is that, the \c RESOURCE_PREFIX argument for
\c{qt_add_qml_module()} defaults to \c{":/"}.

The \c NEW behavior of this policy is that the \c RESOURCE_PREFIX argument
for \c{qt_add_qml_module()} defaults to \c{":/qt/qml/"}. The new behavior
ensures that modules are put into the \l{QML Import Path} and can be
found without further setup.

Qt 6.5 issues warnings if you do not pass any of the following arguments to the
\c qt_add_qml_module command: \c RESOURCE_PREFIX, \c NO_RESOURCE_TARGET_PATH.
Use the \l qt_policy command to suppress the warning by explicitly setting
the policy to \c OLD or \c NEW.

\qtpolicydeprecatedbehavior

\sa qt_policy, {qt6_standard_project_setup}{qt_standard_project_setup()},
    qt_cmake_policies, qt_add_qml_module

*/