PDA

View Full Version : An Application Icon - .pxm format



slava
17th February 2008, 19:49
As I unerstood from the manual, in order to add an icon to the application I need to do:

setWindowIcon(QIcon("icon.pxm"));

What is this pxm format? I have .jpg icons or .ico icons but not pxm. What do I use to create .pxm? Can I use the .ico instead?

ashukla
18th February 2008, 04:53
Dear Slava!

setWindowIcon(QIcon("icon.pxm"));
What is this pxm format? I have .jpg icons or .ico icons but not pxm. What do I use to create .pxm?
First I want to correct you, There is no format of PXM in Qt. XPM is a X11 Pixmap format.

setWindowIcon(QIcon("icon.xpm"));
And you can create this using KolourPaint and save as a file X Pixmap Image (filter option of save as dialog).

Can I use the .ico instead?
Yes! you can use any of the following format;
http://doc.trolltech.com/4.3/qpixmap.html#reading-and-writing-image-files

slava
18th February 2008, 07:52
thank you. Could you please explain me how to do that exactly?

If I do:

setWindowIcon(QIcon("app.jpg"));

... nothing happans, do I need to convert the image first somehow?

mismael85
18th February 2008, 08:02
i am also want to know the answer of this question becouse i did that but the result is:
1- the application icon in the title bar is changed, but.
2- the application icon never changed, i mean the exe file icon.

triperzz
18th February 2008, 08:20
How to Change the Application Icon... tutorial


1. Open notepad.
2. Type: IDI_ICON1 ICON DISCARDABLE "icon.ico"
Note: ”icon.ico is the name of the icon you want to use. ”
3. Save it as icon.rc
Note: When saving, be sure that there is no .txt extention in the filename, it should be a .rc. You can change the filename to whatever filename you want.
4. Open your project. The *.pro file.
5. Add this line : RC_FILE=icon.rc
Note: “icon.rc is the name of the .rc you previously created”
6. Save.
7. Place your desired icon to the folder where your project (*.pro) was located.

8. Finally, build/rebuild your project.

slava
18th February 2008, 08:58
Thank you very much!

mismael85
18th February 2008, 09:54
thank you very much.
can i ask from where did you konw this information?

jpn
18th February 2008, 10:00
It's documented here: Setting the Application Icon (http://doc.trolltech.com/4.3/appicon.html)