QT_EXCLUDE_FROM_TRANSLATION
Essa propriedade foi introduzida no Qt 6.7.
Defina esta propriedade de diretório como ON para excluir todos os alvos no diretório e em seus subdiretórios da tradução. O comando qt_collect_translation_source_targets() ignorará esses alvos.
Para excluir um único alvo, use a propriedade de alvo QT_EXCLUDE_FROM_TRANSLATION.
Exemplos
No exemplo a seguir, as strings traduzíveis não serão extraídas dos alvos definidos no diretório tests.
add_subdirectory(app)
add_subdirectory(tests)
set_property(DIRECTORY tests PROPERTY QT_EXCLUDE_FROM_TRANSLATION ON)
qt_add_translations(myapp)Como alternativa, você pode definir a propriedade de diretório em ` CMakeLists.txt ` do subdiretório ` tests `.
# tests/CMakeLists.txt
qt_add_executable(...)
add_test(...)
set_directory_properties(PROPERTIES QT_EXCLUDE_FROM_TRANSLATION ON)Veja também QT_EXCLUDE_SOURCES_FROM_TRANSLATION.
© 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.