From 7b8cbbff76f04b79d397953510e14b764e0cc279 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 17 Jul 2024 11:18:37 +0200 Subject: [PATCH] Add the note about the runtime encoding in the QString-like classes and QT_NO_UTF8_SOURCE Mention that QT_NO_UTF8_SOURCE has no effect on runtime encoding of QString-like classes. Amends 37e6159ab0c1456e8dc38f38f3b21643585c1273 Pick-to: 6.7 6.5 Task-number: QTBUG-126435 Change-Id: I3629b8af0e3eb7353c9268e23167dbef6802bb00 Reviewed-by: Thiago Macieira Reviewed-by: Leena Miettinen (cherry picked from commit bba0150200e16e6e0a8926dac1f32b00b8b1493b) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/doc/src/cmake/cmake-properties.qdoc | 5 +++++ src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/corelib/doc/src/cmake/cmake-properties.qdoc b/src/corelib/doc/src/cmake/cmake-properties.qdoc index f844fc3e701..ed4ed218481 100644 --- a/src/corelib/doc/src/cmake/cmake-properties.qdoc +++ b/src/corelib/doc/src/cmake/cmake-properties.qdoc @@ -508,6 +508,11 @@ this behavior on a per-target basis by setting the property to \c TRUE: set_property(TARGET target_name PROPERTY QT_NO_UTF8_SOURCE TRUE) \endcode +\note This does not change the runtime behavior of classes like +\l QString (its constructor from \c{const char *} requires properly encoded +UTF-8 input). Use the \l QT_NO_CAST_FROM_ASCII and +\c QT_RESTRICTED_CAST_FROM_ASCII macros to help identify such code. + \sa {qt6_disable_unicode_defines}{qt_disable_unicode_defines()}{qt6_allow_non_utf8_sources()} */ diff --git a/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc b/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc index 6e972ba63a1..b8091d38033 100644 --- a/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc +++ b/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc @@ -30,6 +30,11 @@ is currently implemented for Visual Studio and Intel compilers. You can disable this behavior on a per-target basis by calling \c{qt_allow_non_utf8_sources()} and passing the target as the argument. +\note This does not change the runtime behavior of classes like +\l QString (its constructor from \c{const char *} requires properly encoded +UTF-8 input). Use the \l QT_NO_CAST_FROM_ASCII and +\c QT_RESTRICTED_CAST_FROM_ASCII macros to help identify such code. + \sa {qt6_disable_unicode_defines}{qt_disable_unicode_defines()} {cmake-target-property-QT_NO_UTF8_SOURCE} */