RCC (資源編譯器)

The 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 應用程序中嵌入資源的更多相關信息。