Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Image on showing on another PC's
Forum Updated to NodeBB v4.3 + New Features

Image on showing on another PC's

Scheduled Pinned Locked Moved Solved Installation and Deployment
4 Posts 3 Posters 375 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.
  • X Offline
    X Offline
    xbasista
    wrote on last edited by xbasista
    #1

    Hi,

    I have a problem with showing picture in form in app. On my pc (pc where I am developing app) everything works fine, but when i tried on another pc no picture show. Here is what i tried:

    1. with the code:
      QPixmap pixmap = QPixmap ("logo.JPG");
    //i also tried  QPixmap (":/logo.JPG");
    //and QDir::currentPath() + "logo.JPG"
    
     ui->Logo->setPixmap(pixmap);
     ui->Logo->setScaledContents(true);
    
    1. In the form editor,
      I tried (in the Qlabel options) set pixmap choose resourse, but it no working, so i tried choose file but the same result.

    On testing machine is in the same folder (as *.exe file) the picture.

    In the project.pro is resource file and in resource file is linked image. I tried also run qmake but still same result. Any idea?

    JonBJ 1 Reply Last reply
    0
    • X Offline
      X Offline
      xbasista
      wrote on last edited by
      #3

      Thanks for response.
      Finnally, i found out that i converted file *.JPG to *.png everything is okay.

      1 Reply Last reply
      0
      • X xbasista

        Hi,

        I have a problem with showing picture in form in app. On my pc (pc where I am developing app) everything works fine, but when i tried on another pc no picture show. Here is what i tried:

        1. with the code:
          QPixmap pixmap = QPixmap ("logo.JPG");
        //i also tried  QPixmap (":/logo.JPG");
        //and QDir::currentPath() + "logo.JPG"
        
         ui->Logo->setPixmap(pixmap);
         ui->Logo->setScaledContents(true);
        
        1. In the form editor,
          I tried (in the Qlabel options) set pixmap choose resourse, but it no working, so i tried choose file but the same result.

        On testing machine is in the same folder (as *.exe file) the picture.

        In the project.pro is resource file and in resource file is linked image. I tried also run qmake but still same result. Any idea?

        JonBJ Online
        JonBJ Online
        JonB
        wrote on last edited by
        #2

        @xbasista
        If you use QPixmap pixmap = QPixmap ("logo.JPG"); it will only work if you properly deploy on another computer, so that external file is in the right place to be found.

        If you use QPixmap (":/logo.JPG"); that will not require an external file on target machine, the file should be properly compiled into executable's resources. You need to give more details as to why you say this is not working.

        If your "testing machine" is not a development machine just like your original machine where it works, you need to deploy a Qt application to make it work correctly, e.g. windeployqt.

        1 Reply Last reply
        3
        • X Offline
          X Offline
          xbasista
          wrote on last edited by
          #3

          Thanks for response.
          Finnally, i found out that i converted file *.JPG to *.png everything is okay.

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

            Hi,

            This means that you did not deploy the image format plugins correctly or not completely.

            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
            1

            • Login

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