Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Icons of resource don't show up when taking the exe out of QtCreator
Forum Updated to NodeBB v4.3 + New Features

[Solved]Icons of resource don't show up when taking the exe out of QtCreator

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheDestroyer
    wrote on last edited by
    #1

    Hello guys :),

    I'm using some small icons in my program, where they appear in some lists and combo boxes. The resource file is defined as follows:

    @
    <!DOCTYPE RCC><RCC version="1.0">
    <qresource>
    <file>LaserRed.ico</file>
    <file>Source.ico</file>
    <file>Oscillator.ico</file>
    </qresource>
    </RCC>
    @

    and in the qmake file it's defined as follows:

    @
    RC_FILE += rsrcs.qrc

    RESOURCES += rsrcs.qrc
    @

    When I execute the program through QtCreator, the icons show up correctly with no problems. But when I take the executable and execute it through windows explorer, I get this problem, where the icons don't appear.

    Any ideas?

    Thank you for any efforts.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DerManu
      wrote on last edited by
      #2

      Strange behaviour.

      I'll take a guess: the .ico files need an imageReader plugin that's sitting in the default Qt installation dir. When launched from QtCreator, the IDE sets the environment variables to those locations so the applications find the imageReaders and all the other stuff. But when you launch from outside QtCreator the application can't find the plugins and thus fails to load the .ico.
      If this is the case, you have two options: switch from the microsoft .ico to a proper format like .png that is supported natively by Qt. Or copy the appropriate imageReader plugin to a place where the app can find it (I think the plugins must be in a directory "imageformats" in the executable's directory).

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TheDestroyer
        wrote on last edited by
        #3

        I got it. It doesn't have to do with ico or other types (but thanks though, using jpg reduced the executable size by 25%).

        The problem was that I was using Qt 4.8.0 Dlls while the program was compiled with Qt 4.8.1.

        My mistake. Sorry.

        I'm keeping this for future reference.

        Thanks for the help :)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved