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. QLabel cannot display image on other computer
Forum Updated to NodeBB v4.3 + New Features

QLabel cannot display image on other computer

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 4.2k 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.
  • Z Offline
    Z Offline
    zff518
    wrote on last edited by
    #1

    I wrote a small program to show images on a QLabel, which is the central widget of the mainwindow.

    The program works fine on my computer, it is the developing machine, with windows 7, vs 2008 and QT 4.6.3

    But after i deployed my program to other computer with (all files are in the same folder)

    the released exe file

    the dlls including QtCore4.dll, QtGui4.dll and all the image plugin dlls such as qjpeg4.dll etc.

    the visual studio dlls including msvcp90.dll and msvcr90.dll

    I started the program on that computer also with windows 7, the mainwindow came, all the actions, gui things worked fine too, but no image can be displayed.

    I dont know where the problem is, can somebody help me?

    thanks.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      You need to put image plugin in imageformats directory

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Chuck Gao
        wrote on last edited by
        #3

        Do you use a related path for your image or add it to your qrc?

        Chuck

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

          [quote author="cincirin" date="1311764068"]You need to put image plugin in imageformats directory[/quote]

          Do that. More info: http://doc.qt.nokia.com/4.7/deployment-plugins.html

          Software Engineer
          KDAB (UK) Ltd., a KDAB Group company

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            zff518
            wrote on last edited by
            #5

            I have put the whole imageformats plugin folder, the "imageformats" folder, into the program folder and the problem is solved.

            Thank you very much.

            p.s.: The images are arbitrary on the harddisk, not included in src. I used a filedialog in code to find the image files.

            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