Results 1 to 4 of 4

Thread: Application icon from .qrc file

  1. #1
    Join Date
    Oct 2009
    Posts
    65
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Application icon from .qrc file

    Hello to everybody,
    I'm a newbie with QT, and while I try to compile my application, I saw this strange behavior (strange, probably only for me).
    I can configure, by mean of .qrc (QT Resource file) all the images, and icon for my application, and find them by resource path (:/prefix/files) but... How can I set the application icon (the icon of .exe executable)?
    Looking up on-line documentation, i found a guide that explain the use of a .rc files, in which i should describe the icon and add this to the .pro file. I try it, it work fine, but, why It is necessary? Is it impossible take the application icon from the .qrc file, so the .qrc file substitute completely the .rc file? If no, why?

    Thanks for your answers.

    Michele

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Application icon from .qrc file

    It is Windows (in this case) that is looking at the executable and extracting the icon to display in the Start Menu or on the Desktop. Windows does not know anything about the internals of a Qt program, so it cannot be expected to find a Qt resource buried in the executable. The Windows resource file and compiler attaches resources to the binary in a way Windows can access.

    Other operating systems use icon files external to the application.

  3. #3
    Join Date
    Oct 2009
    Posts
    65
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application icon from .qrc file

    Thanks Chris for your answer.
    I imagined something like this, but I thought that there is a way to generate automatically the .rc file from the .qrc file.
    Is there somthing like this? If there isn't, no way, I'll use the .rc file only for Application Ico.

    Thanks a lot

    Michele

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Application icon from .qrc file

    There's nothing I'm aware of that does this. There's much more than just an application icon that can go in the Windows RC file: version resources (look at file properties/version), localised names etc. Qt does make some allowances for the Windows resources: it adds resources when using ActiveQt and can generate a manifest file to be included when using Visual Studio.

Similar Threads

  1. Application icon - Qt S60
    By ppaluch in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 23rd November 2010, 11:17
  2. How to set the application icon in Linux?
    By live_07 in forum Newbie
    Replies: 11
    Last Post: 24th September 2010, 09:39
  3. Replies: 0
    Last Post: 17th March 2010, 13:25
  4. Add Application Icon without PRO file?
    By grantbj74 in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2010, 01:31
  5. compile icon into application
    By BlackFoXX in forum Qt Programming
    Replies: 4
    Last Post: 1st May 2009, 21:41

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.