QT_EXCLUDE_SOURCES_FROM_TRANSLATION

Diese Eigenschaft wurde in Qt 6.7 eingeführt.

Diese Zieleigenschaft gibt eine Liste von Quelldateipfaden an, die von der Übersetzung ausgeschlossen sind. Quelldateien, die den Mustern in dieser Ausschlussliste entsprechen, werden von lupdate ignoriert.

Die Pfade können absolut oder relativ zu CMAKE_CURRENT_SOURCE_DIR sein. Die Pfade können Wildcards in einem Format enthalten, das von QRegularExpression::wildcardToRegularExpression akzeptiert wird.

Beispiele

Schließt untranslatable.cpp und rekursiv jede Datei unter dem Verzeichnis 3rdparty aus.

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/*
)

Siehe auch qt_add_lupdate, target-Eigenschaft QT_EXCLUDE_FROM_TRANSLATION, und Verzeichnis-Eigenschaft 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.