Results 1 to 8 of 8

Thread: An Application Icon - .pxm format

  1. #1
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Question An Application Icon - .pxm format

    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?

  2. #2
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: An Application Icon - .pxm format

    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...ng-image-files
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  3. #3
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Question Re: An Application Icon - .pxm format

    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?

  4. #4
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: An Application Icon - .pxm format

    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.

  5. #5
    Join Date
    Jan 2008
    Posts
    33
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: An Application Icon - .pxm format

    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.

  6. The following 2 users say thank you to triperzz for this useful post:

    mismael85 (18th February 2008), slava (18th February 2008)

  7. #6
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Default Re: An Application Icon - .pxm format

    Thank you very much!

  8. #7
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: An Application Icon - .pxm format

    thank you very much.
    can i ask from where did you konw this information?

  9. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: An Application Icon - .pxm format

    It's documented here: Setting the Application Icon
    J-P Nurmi

  10. The following user says thank you to jpn for this useful post:

    mismael85 (18th February 2008)

Similar Threads

  1. How to set the application icon in Linux?
    By live_07 in forum Newbie
    Replies: 11
    Last Post: 24th September 2010, 09:39
  2. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  3. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.