Right click the left project tree, click “Add New …”
Select “Qt” in the left panel, and “Qt Resource file” in the right panel
In the left project tree, there will be a new *.qrc file added under “Resources” folder. Click “Add” drop box in the right panel, but you can see the “Add files” button is disabled. You must “Add prefix” before you add an image file. The prefix is something like “/Something/…”, which you might reference in code.
Click the “Add Prefix” button, and in this case, I simply use “/”
Then Add image files by clicking the “Add Files” button:
Browse image files in the dialog poped
In code, you will then be able to reference this image as shown below:
Filed under: Programming
