Quantcast
Channel: Programming – Xinyustudio
Viewing all articles
Browse latest Browse all 284

Nokia Qt: Add and reference image resources

$
0
0

Right click the left project tree, click “Add New …”

image

 

 

 

 

 

 

 

 

 

 

 

 

Select “Qt” in the left panel, and “Qt Resource file” in the right panel

image

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.

image

Click the “Add Prefix” button, and in this case, I simply use “/”

image

Then Add image files by clicking the “Add Files” button:

image

Browse image files in the dialog poped

image

In code, you will then be able to reference this image as shown below:

image


Filed under: Programming

Viewing all articles
Browse latest Browse all 284

Trending Articles