qt_exclude_sources_from_translation

このプロパティは Qt 6.7 で導入されました。

このターゲット・プロパティは、翻訳から除外されるソース・ファイル・パスのリストを指定します。この除外リストのパターンに一致するソース・ファイルは、lupdate によって無視されます。

パスは、CMAKE_CURRENT_SOURCE_DIR からの絶対パスでも相対パスでもかまいません。パスは、QRegularExpression::wildcardToRegularExpression で受け入れられる形式のワイルドカードを含むことができます。

untranslatable.cpp および3rdparty ディレクトリ以下のすべてのファイルを再帰的に除外します。

qt_add_executable(myapp
    main.cpp
    untranslatable.cpp
    3rdparty/sqlite/sqlite3.h
    3rdparty/sqlite/sqlite3.c
    3rdparty/zlib/src/gzlib.c
    3rdparty/zlib/src/zlib.h
)
set_property(TARGET myapp PROPERTY QT_EXCLUDE_SOURCES_FROM_TRANSLATION
    untranslatable.cpp
    3rdparty/*
)

qt_add_lupdateターゲット・プロパティ QT_EXCLUDE_FROM_TRANSLATION、およびディレクトリ・プロパティ QT_EXCLUDE_FROM_TRANSLATIONも参照してください

© 2025 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.