RCC (资源编译器)

rcc 工具被用于在构建过程中把资源嵌入 Qt 应用程序。它通过生成包含在 Qt 资源 .qrc 文件中的指定数据的 C++ 源文件工作。

用法:

rcc [options] <inputs>
					

RCC (资源编译器) 接受以下命令行选项:

选项 自变量 描述
-o file 写入输出到 file 而不是到 stdout (标准输出)。
-g, --generator <cpp|python|python2> 选择生成器。
-name 名称 创建外部初始化函数采用 名称 .
-threshold level 指定阈值 level (as a percentage) to use when deciding whether to compress a file. If the reduction in the file size is greater than the threshold level , it is compressed; otherwise, the uncompressed data is stored instead. The default threshold level is 70%, meaning that compressed files which are 30% or less of their original size are stored as compressed data.
-compress-algo algorithm The algorithm to compress files with. Supported algorithms are zstd , zlib ,和 none , which respectively mean to compress the content using the Zstandard 库, zlib library, and no compression. The default is zstd if that library was found at compile time, zlib 若不。
-compress level Compress input files to the given compression level , which is algorithm-dependent. If the algorithm is zstd , the valid levels are 1 to 19, with the special values of 0 and -1 meaning libzstd 's and rcc 's default compressions. If the algorithm is zlib , the level is an integer in the range 1 to 9. For both algorithms, level 1 does the least compression but is fastest. Levels 9 or 19 do the most compression but are slowest. To turn off compression, use -no-compress 。默认值对于 level 为 -1。
-root path 前缀资源访问路径采用 path 。默认无前缀。
-no-compress 禁用压缩。
--pass <number> 用于大资源的通行编号
-binary 输出二进制文件为用作动态资源。
-version 显示版本信息。
-help 显示用法信息。
-t, --temp <file> 使用临时 <file> 为大资源。
--namespace 关闭名称空间宏。
--verbose 启用冗余模式。
--list 仅列出 .qrc 文件条目,不生成代码。
--list-mapping Only output a mapping of resource paths to file system paths defined in the .qrc file, do not generate code.
-d, --depfile <file> Write a depfile with the .qrc dependencies to <file>.
-project 输出包含所有文件 (来自当前目录) 的资源文件。
--format-version <number> 要写入的 RCC (资源编译器) 格式版本。

另请参阅 Qt 资源系统 了解在 Qt 应用程序中嵌入资源的更多相关信息。