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
qtp0001.qdoc
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qt-cmake-policy-qtp0001.html
6\ingroup qt-cmake-policies
7
8\title QTP0001
9\keyword qt_cmake_policy_qtp0001
10
11\summary {':/qt/qml/' is the default resource prefix for QML modules.}
12
13This policy was introduced in Qt 6.5. It changes where
14\l{qt_add_qml_module}{qt_add_qml_module()} stores QML resources in
15the resource system.
16
17Enabling this policy ensures that your QML module is placed under
18a default \l {QML Import Path}{import path}, and its types can be
19found without manual calls to \l QQmlEngine::addImportPath.
20
21The \c OLD behavior of this policy is that, the \c RESOURCE_PREFIX argument for
22\c{qt_add_qml_module()} defaults to \c{":/"}.
23
24The \c NEW behavior of this policy is that the \c RESOURCE_PREFIX argument
25for \c{qt_add_qml_module()} defaults to \c{":/qt/qml/"}. The new behavior
26ensures that modules are put into the \l{QML Import Path} and can be
27found without further setup.
28
29Qt 6.5 issues warnings if you do not pass any of the following arguments to the
30\c qt_add_qml_module command: \c RESOURCE_PREFIX, \c NO_RESOURCE_TARGET_PATH.
31Use the \l qt_policy command to suppress the warning by explicitly setting
32the policy to \c OLD or \c NEW.
33
34\qtpolicydeprecatedbehavior
35
36\sa qt_policy, {qt6_standard_project_setup}{qt_standard_project_setup()},
37 qt_cmake_policies, qt_add_qml_module
38
39*/