Resource Compiler (rcc)#
The rcc tool is used to embed resources into a Qt application during the build process. It works by generating a C++ source file containing data specified in a Qt resource (.qrc) file.
Usage:
rcc [options] <inputs>
RCC accepts the following command line options:
Option
Argument
Description
-o
fileWrite output to
filerather than to stdout.
-g, --generator
<cpp|python|python2>Select generator.
-name
nameCreate an external initialization function with
name.
-threshold
levelSpecifies a threshold
level(as a percentage) to use when deciding whether to compress a file. If the reduction in the file size is greater than the thresholdlevel, 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
algorithmThe algorithm to compress files with. Supported algorithms are
zstd,zlib, andnone, which respectively mean to compress the content using the Zstandard library, zlib library, and no compression. The default iszstdif that library was found at compile time,zlibif not.
-compress
levelCompress input files to the given compression
level, which is algorithm-dependent. If the algorithm iszstd, the valid levels are 1 to 19, with the special values of 0 and -1 meaninglibzstd's andrcc's default compressions. If the algorithm iszlib, 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. The default value forlevelis -1.
-root
pathPrefix the resource access path with
path. The default is no prefix.
-no-compressDisable compression.
--pass
<number>Pass number for big resources
-binaryOutput a binary file for use as a dynamic resource.
-versionDisplay version information.
-helpDisplay usage information.
-t, --temp <file>Use temporary <file> for big resources.
--namespaceTurn off namespace macros.
--verboseEnable verbose mode.
--listOnly list .qrc file entries, do not generate code.
--list-mappingOnly 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>.
-projectOutput a resource file containing all files from the current directory.
--format-version
<number>The RCC format version to write.
See also The Qt Resource System for more information about embedding resources in Qt applications.