Apr 062010
 

Our article on the creation of bitmap icons for Symbian applications is one of the most-read and most-linked ones on Forum Nokia – if that doesn’t give a clear indication that people are fed up with SVG crap, what does?

The introduction of Qt has not done much about the issue. Instead, it made our life even more difficult as we no longer control the rss and mmp files – QMake generates them out of the information found in the .pro file. Fortunately, there is a way around – read on to find out more about bitmap icons for Symbian Qt applications.

Step 1 – create icon files
This has largely been explained in the first part of the article. This time, I just assume that the following six files are present in the folder structure as shown below:

DIR gfx
- 24.134 bigicon.bmp
- 18.254 bigicon_mask.bmp
- 14.054 midicon.bmp
- 10.654 midicon_mask.bmp
- 6.138 smlicon.bmp
- 6.138 smlicon_mask.bmp
3.389 QtBallZ.h
494 QtBallZ.loc
1.817 QtBallZ.pro
...

Step 2 – create icon MBM
Next up is the MBM, which will contain the images when done. In traditional Symnbian C++, creating an MBM file is easy – not here. Fortunately, the syntax for the creation of an MBM file is relatively dumb – so why not add it to the MMP file ourselves. Adding stuff to an MMP file is straightforward – edit the .pro file to look like this, and run QMake again:

symbian: {
TARGET.UID3 = 0x2002CAC7

...

MMP_RULES += "START BITMAP QtBallZ_icons.mbm"
"HEADER"
"SOURCEPATH .gfx"
"SOURCE c24,1 midicon.bmp midicon_mask.bmp smlicon.bmp smlicon_mask.bmp bigicon.bmp bigicon_mask.bmp"
"TARGETPATH resourceapps"
"END"

}

If you now recompile the app in various build configurations (try WINSCP and GCCE debug), you will end up with the MBM file named above – the example above creates QtBallZ_icons.mbm.

Step 3 – deploy MBM file
Adding the MBM file to the sis is also easy. This happens via the .pro file, too – it will then update the PKG automatically. This step is somewhat sensitive – no extra spaces allowed!!!!
symbian: {
TARGET.UID3 = 0x2002CAC7
...
moreFiles.pkg_postrules = ""$(EPOCROOT)epoc32\data\z\resource\apps\QtBallZ_icons.mbm" -"!:\resource\apps\QtBallZ_icons.mbm""
DEPLOYMENT += moreFiles

}

Step 4 – connect
The final step is the most annoying one. It involves looking for the bold segment in ALL project files, and adding the two lines indented in the sample below:
RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
{
short_caption = STRING_r_short_caption;
caption_and_icon =
CAPTION_AND_ICON_INFO
{
caption = STRING_r_caption;
number_of_icons = 2;
icon_file="\Resource\Apps\QtBallZ_icons.mbm";

};
}

This is annoying for one reason: qmake will undo it whenever it gets called. This means that you need to redo it every time before you compile a SIS build (CVS is helpful here).

Step 5 – test
Compile the program – if something is wrong, it will usually show up in the console. Just open it in full screen, and look at every line – it may be boring but helps. Then, deploy the sis to the phone, install it AND TURN OFF THE PHONE TO FLUSH THE ICON CACHE. After a reboot, your icon should be there!

Looks like we’ve beaten the SVG mafia one more time. The hoops the SVG fetishists put up get higher and higher – but trust good ole Tamster to show you the way to bitmap icon goodness…


Related posts:

  1. Bitmap application icons for S60 / Symbian
  2. Sony Ericsson Vivaz distorts bitmap application icons
  3. Sony Ericsson Vivaz bitmap icons – the official fix
  4. Signing QT apps for Ovi – the inofficial how-to
  5. Proper sound and background music with Qt for Symbian

  6 Responses to “Bitmap application icons for Symbian – Qt edition”

  1. I cant make it :\ :( :’(
    can anybody help me?

    my project is on
    http://bandolir.hippy.csoma.elte.hu/qt/WorkTime.zip

    thx all!

  2. what make i wrong?

  3. Hi,
    nice to see you here.

    Two things:
    a) What happens on your phone
    b) Have you tried to reboot after installing the SIS?

    All the best
    Tam

  4. the application has default icon
    and i didnt reboot it
    now i rebooted it but nothing else this have default icon

  5. now i make that i write in the pro file
    ICON = icon.svg
    default solution

  6. Hi,
    you always need to reboot as to update the icon cache!

    The solution above is not for SVG – it is ONLY for bitmap icons! What are you trying to accomplish?

    With best regards
    Tam Hanna

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting