Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qt_policy.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2022 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt-policy.html
6
\ingroup cmake-commands-qtcore
7
8
\title qt_policy
9
\keyword qt6_policy
10
11
\summary {Modify the default behavior of Qt's CMake API.}
12
13
\include cmake-find-package-core.qdocinc
14
15
\cmakecommandsince 6.5
16
17
\section1 Synopsis
18
19
\badcode
20
qt_policy(
21
[SET <policy_name> behavior]
22
[GET <policy_name> <variable>]
23
)
24
\endcode
25
26
\versionlessCMakeCommandsNote qt6_policy()
27
28
\section1 Description
29
30
This command has two modes:
31
32
\list
33
\li When the \c{SET} keyword is used, this command can be used to opt in to
34
behavior changes in Qt's CMake API, or to explicitly opt out of them.
35
\li When the \c{GET} keyword is used, \c{<variable>} is set to the current
36
behavior for the policy, i.e. \c OLD or \c NEW.
37
\endlist
38
39
\c{<policy_name>} must be the name of one of the \l{Qt CMake policies}.
40
Policy names have the form of \c{QTP<NNNN>} where <NNNN> is
41
an integer specifying the index of the policy. Using an invalid policy
42
name results in an error.
43
44
Code supporting older Qt versions can check the existence of a policy by
45
checking the value of the \c{QT_KNOWN_POLICY_<policy_name>} variable before
46
getting the value of \c <policy_name> or setting its behavior.
47
48
\badcode
49
if(QT_KNOWN_POLICY_<policy_name>)
50
qt_policy(SET <policy_name> NEW)
51
endif()
52
\endcode
53
54
You can set \c behavior to one of the following options:
55
56
\list
57
\li \c{NEW} to opt into the new behavior
58
\li \c{OLD} to explicitly opt-out of it
59
\endlist
60
61
\qtpolicydeprecatedbehavior
62
63
\sa qt_standard_project_setup
64
65
*/
qtbase
src
corelib
doc
src
cmake
qt_policy.qdoc
Generated on
for Qt by
1.14.0