Nokia Qt: Add and reference image resources

19 Jul

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:


Leave a comment

Posted by on July 19, 2012 in Programming


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: