diff options
Diffstat (limited to 'src/qml/doc')
-rw-r--r-- | src/qml/doc/snippets/qml/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/qml/doc/src/cmake/policy/qtp0001.qdoc | 36 |
2 files changed, 38 insertions, 1 deletions
diff --git a/src/qml/doc/snippets/qml/CMakeLists.txt b/src/qml/doc/snippets/qml/CMakeLists.txt index 5dd190d004..7c7ac116c3 100644 --- a/src/qml/doc/snippets/qml/CMakeLists.txt +++ b/src/qml/doc/snippets/qml/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -qt_add_library(extra_module STATIC) +qt_add_library(extra_module STATIC) qt_add_qml_module(extra_module URI "ExtraModule" VERSION 1.0 @@ -9,6 +9,7 @@ qt_add_qml_module(extra_module Extra.qml SOURCES extrathing.cpp extrathing.h + RESOURCE_PREFIX / ) add_subdirectory(ExtraModule) diff --git a/src/qml/doc/src/cmake/policy/qtp0001.qdoc b/src/qml/doc/src/cmake/policy/qtp0001.qdoc new file mode 100644 index 0000000000..a5381647c9 --- /dev/null +++ b/src/qml/doc/src/cmake/policy/qtp0001.qdoc @@ -0,0 +1,36 @@ +// 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. + +The \c OLD behavior of this policy is that, unless +\c AUTO_RESOURCE_PREFIX is set, 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 AUTO_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. + +\note The \c{OLD} behavior of a policy is deprecated, and may +be removed in the future. + +\sa qt_policy, qt_cmake_policies, qt_add_qml_module + +*/ |