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. Image won't display
Qt 6.11 is out! See what's new in the release blog

Image won't display

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello!

    Like in title I got problem with Image. I'm using QLabel and QPushButton. After adding icon, or Pixmap and building whole project in final app I see only buttons, but not images, any idea how solve it?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome to the Qt Dev Net!

      Does the image show when you run it from inside Qt Creator?

      Assuming that your image is in JPEG format, did you include qjpeg.dll? See http://qt-project.org/wiki/Deploy_an_Application_on_Windows (the guide is written for Windows but the ideas apply to all platforms)

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Are you using a relative path to load your images ?
        e.g.

        @QImage img("myCoolImage.png");@

        If so, the program will look for it in the executable folder which is not the same as the folder you have your images in. You should either give the full path to the files or copy the files in the same folder as the executable.

        Hope it helps

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          In Qt Creator everything look ok, but in .exe file i dont see images.
          I add images to project, but i don't write anythink in actual code. I just move wigets and change options. All files are .png format.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            It was problem with paths. I have files in my project folder, but not in my release folder.

            Thanks for advices.

            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