QTP0006

Enables PRIVATE_CODE as the default for Wayland protocol source generation.

This policy was introduced in Qt 6.12. The policy affects the behavior of qt_generate_wayland_protocol_client_sources and qt_generate_wayland_protocol_server_sources when called without PRIVATE_CODE or PUBLIC_CODE.

If the policy is set to OLD, and neither PUBLIC_CODE nor PRIVATE_CODE is passed, the function behaves as if PUBLIC_CODE was passed and a deprecation warning is emitted.

If the policy is set to NEW, and neither PUBLIC_CODE nor PRIVATE_CODE is passed, the function behaves as if PRIVATE_CODE was passed and no deprecation warning is emitted.

When the policy is not set, and neither PUBLIC_CODE nor PRIVATE_CODE is passed, an AUTHOR_WARNING is emitted and the function behaves as if PUBLIC_CODE was passed for backwards compatibility.

For example, the following code does not pass PUBLIC_CODE or PRIVATE_CODE. Because QTP0006 is not set, an AUTHOR_WARNING is emitted:

# QTP0006 not set — AUTHOR_WARNING is emitted
qt_generate_wayland_protocol_client_sources(MyTarget
    FILES myprotocol.xml
)

If you set QTP0006 to NEW before the call, the function behaves as if PRIVATE_CODE was passed and no warning is emitted:

qt_policy(SET QTP0006 NEW)
qt_generate_wayland_protocol_client_sources(MyTarget
    FILES myprotocol.xml
)

The same policy behaviour applies to qt_generate_wayland_protocol_server_sources.

Note: The OLD behavior of a policy is deprecated, and may be removed in the future.

See also qt_policy, Qt CMake policies, qt_generate_wayland_protocol_client_sources, and qt_generate_wayland_protocol_server_sources.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.