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] Application not displaying .ico file format
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Application not displaying .ico file format

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 5.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.
  • V Offline
    V Offline
    vezprog
    wrote on last edited by
    #1

    When a QToolButton is clicked on my application, I give the user the option to add a custom icon (external .ico file located on the file system anywhere). The file that is selected is then placed as the icon on the QToolButton. This works perfect on my PC running windows with the QtSDK installed (windows 7), but with my application in release mode on another PC linked to the .dlls dynamically located in the application folder (no QtSDK) the .ico files do not show on my QToolButton when the button is clicked, and an external .ico is selected. Everything else works perfect except for the icons not being displayed.

    Unfortunately I cannot put them in a resource file since the user could select ANY icon file on the file system or anywhere for that matter.

    I have read multiple instances of this happening to people and there has been no definite solution on any threads, so I have tried these things so far:
    Adding the plugins to my executable folder that came with the QtSDK for my build version
    Using QApplication::addLibraryPath() to add the plugins path in my main.cpp

    I have run out of thoughts...I know its got to be something simple with linking to plugins or something of that nature...Does anyone have an idea of what could be going wrong?

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

      bq. Unfortunately I cannot put them in a resource file since the user could select ANY icon file on the file system or anywhere for that matter.

      Do you mean that the .ico will be shown properly once you put them to resources? or this is just you guess?

      bq. Adding the plugins to my executable folder that came with the QtSDK for my build version
      Using QApplication::addLibraryPath() to add the plugins path in my main.cpp

      More details need. where the plugin your put to? where the plugin you copied from?

      • yourApplication.exe
      • QtCore4.dll
      • QtGui4.dll
      • ...
      • imageformats/qico4.dll
      • ...
      1 Reply Last reply
      0
      • V Offline
        V Offline
        vezprog
        wrote on last edited by
        #3

        I had it pretty much the same as shown above but this:

        myapp.exe
        QtCore4.dll
        QtGui4.dll
        qico4.dll

        I tried:
        qico4.dll
        imageformats/qico4.dll
        plugins/imageformats/qico.dll

        but it made sense to me the first way since thats how it links up to the other executables

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on last edited by
          #4

          [quote author="dvez43" date="1337395426"]
          I tried:
          qico4.dll
          imageformats/qico4.dll
          plugins/imageformats/qico.dll

          but it made sense to me the first way since thats how it links up to the other executables[/quote]

          No, the first is always WRONG unless you have changed source code of Qt itself.

          The third will work if you have added the "plugins" to your application's libraryPath. You can directly call addLibraryPath(). or you can use qt.conf file, or use environment variable, or even changing the strings in QtCore4.dll itself(yes, using a hexeditor or something similar).

          The second way it easily to use, nothing special need to to.


          By the way, make sure that qico4.dll copied from right place, as you may have more that one qico4.dll exist in your SDK.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vezprog
            wrote on last edited by
            #5

            I am using the msvc2008 compiler so i got it from desktop/4.8.1/msvc2008/plugins...ect act

            Thank you for your help, I will give it a shot in the morning. I have run into this before but got around it be converting the .ico to png's...but in this case, I cannot.

            Thanks again.

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vezprog
              wrote on last edited by
              #6

              I went back and diddled around with it a little bit and found that the 2nd way worked! thank you very much 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