Results 1 to 16 of 16

Thread: why do icons only show up on my computer ??

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: why do icons only show up on my computer ??

    Try converting one of your ico files to png and make sure the png file is added to the qrc resources and compiled into your program. I do this for all of my toolbar icons and do not need to deploy any image handling plugins with my app. Works just fine on a PC with no Qt installed, just the few DLLs that my app needs installed in the app directory along side of the EXE file.

    I have not tried to use an ico file directly, since I get most of my icons in png format. Your problem could be as simple as not having the file built into the resources, but I would try the png conversion first.

  2. #2
    Join Date
    Nov 2009
    Posts
    61
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    9
    Thanked 3 Times in 3 Posts

    Default Re: why do icons only show up on my computer ??

    @d_stranz. Hi. Do you think there is a problem with rendering icons via ICO files? I am using the same *.ico file for Desktop, windows title, and system tray icons. In my machine, everything works well (Win 7 64bit). On another machine where Qt is not installed, what I know is that system icon is not rendered but all the other looks correct.

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

    Default Re: why do icons only show up on my computer ??

    The icon (*.ico) you have embedded in Windows resources for display as the application icon is read and interpreted by Windows not Qt. This is why it displays correctly in Windows contexts (desktop, task bar).

    That same *.ico file requires the ICO image format plugin in order for Qt to display it. PNG files work out-of-the box because their processing is built in, other formats (GIF, JPEG, ICO, TIFF, MNG) require a plugin that is loaded (if available) on program start or demand. Dependency Walker (DW) will show you the libraries that are early-bound to the executable, i.e. known to be required up front, when you open the executable. If you run the executable in DW profiling mode you may see other libraries pulled in dynamically. I do not think you will see failures to load the ICO image format plugin because Qt only attempts to load the plugins it finds. On your dev machine the plugins are present and the *.ico file can be displayed by Qt. If you deploy without the relevant image format plugins then the deployed system will be unable to display images of that format: displaying a blank space instead of crashing.

    The solution is simply to create a folder called imageformats next to your deployed executable and place qico4.dll in that folder.
    Here is an example layout

  4. The following 3 users say thank you to ChrisW67 for this useful post:

    masher (20th September 2012), ZikO (20th September 2012), Zlatomir (20th September 2012)

Similar Threads

  1. Show Icons in Header of QTreeView
    By blackbubblegum in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2012, 00:55
  2. QMenu does not show icons from QAction
    By eumel1990 in forum Newbie
    Replies: 5
    Last Post: 10th September 2011, 10:57
  3. How to show images from database as icons in QListView
    By LeshaS in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2011, 07:13
  4. QListWidget doesn't show icons
    By franco.amato in forum Qt Programming
    Replies: 8
    Last Post: 16th March 2010, 14:15
  5. how to show richtext and icons in one widget in QT2
    By pencilren in forum Qt Programming
    Replies: 1
    Last Post: 16th May 2007, 10:30

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.