qt_add_webengine_dictionary

此命令在 Qt 6.3 中引入。

简介

qt_add_webengine_dictionary(
    [TARGET]
    [SOURCE]
    [OUTPUT_DIRECTORY]
)

如果禁用了无版本命令,请使用qt6_webengine_add_dictionary() 。它支持与此命令相同的参数集。

说明

Qt Web Engine 中的拼写检查程序需要特定二进制格式的字典。这条 CMake 命令将Hunspell 项目中的字典转换为bdict 二进制格式。它会创建一个qtwebengine_dictionaries target,你的项目可以将其作为依赖项。这样,您的项目就可以轻松地为拼写检查程序添加词典。详情请参阅拼写检查程序示例

参数

TARGET 是一个可选参数,用于指定应依赖于 目标器的应用程序目标器名称。换句话说,它用于定义构建依赖关系,以便在构建 之前创建二进制格式的词典。qtwebengine_dictionaries TARGET

SOURCEHunspell 项目字典的绝对路径,将为其创建相应的二进制格式 ( )。.bdict

OUTPUT_DIRECTORY 是一个可选参数,用于指定创建二进制格式词典的目录。如果未指定, 将作为 使用。CMAKE_CURRENT_BINARY_DIR OUTPUT_DIRECTORY

注意: 在多配置生成器情况下,qtwebengine_dictionaries 目录或<CONFIG>/qtwebengine_dictionaries 目录将附加到 OUTPUT_DIRECTORY。这有助于使用字典,因为webengine_dictionaries 目录是默认的搜索位置。

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