QT_NO_UTF8_SOURCE

Impedisce che i file sorgente vengano trattati come UTF-8 per Windows.

Questa proprietà è stata introdotta in Qt 6.0.

Durante la compilazione con alcuni compilatori per Windows, i target che effettuano il collegamento a una libreria Qt utilizzano flag che impongono al compilatore di trattare i propri file sorgente come UTF-8. Attualmente questa funzionalità è implementata per i compilatori Visual Studio e Intel. È possibile disabilitare questo comportamento a livello di singolo target impostando la proprietà su TRUE:

set_property(TARGET target_name PROPERTY QT_NO_UTF8_SOURCE TRUE)

Nota: ciò non modifica il comportamento in fase di esecuzione di classi come ` QString ` (il cui costruttore, definito in ` const char * `, richiede un input UTF-8 correttamente codificato). Utilizzare le macro ` QT_NO_CAST_FROM_ASCII ` e ` QT_RESTRICTED_CAST_FROM_ASCII ` per identificare più facilmente tale codice.

Vedi anche qt_disable_unicode_defines() e qt_allow_non_utf8_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.