Tuesday, July 28, 2009

how to compile resource file in Qt

A resource file tells the location of the images defined in the ui file. It needs to be compiled in order for the code to use. Hopefully, in the resource file, the alias are defined, so that the relative path is used for each image, and therefore good for the portability.

To compile the resource file (resource.qrc) under the visual c++ environment, make sure the compiler knows the path of Qt.

Go to the bin path under Qt, for instance, cd C:\Qt\bin
type "rcc path\resource.qrc -o path\resource.rcc"

This will create rcc file which is recognized by the compiler.

No comments: