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. .png images don't show when deploy
Forum Updated to NodeBB v4.3 + New Features

.png images don't show when deploy

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
3 Posts 2 Posters 823 Views
  • 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.
  • S Offline
    S Offline
    Samega7Cattac
    wrote on last edited by
    #1

    I making a simply GUI with Qt, and have 2 images (splashscreen and a label).
    When I run the program inside Qt it work and the images too.
    But when I deploy the program with "windeployqt" command the images don´t work.
    Code of the spash screen:

    QSplashScreen * splashScreen = new QSplashScreen;
        splashScreen->setPixmap(QPixmap(":/images/7Guard.png"));
        splashScreen->move((ScreenWidth/2)-(splashScreen->width()/2), (ScreenHeight/2)-(splashScreen->height()/2));
        splashScreen->show();
    

    In the label I choose the file "7Guard7.png" from the resources file in the pixmap proprieties of the label.

    Code of the resources files:

    <RCC>
        <qresource prefix="/images">
            <file>7Guard.png</file>
            <file>7Guard7.png</file>
        </qresource>
    </RCC>
    
    m.sueM 1 Reply Last reply
    0
    • S Samega7Cattac

      I making a simply GUI with Qt, and have 2 images (splashscreen and a label).
      When I run the program inside Qt it work and the images too.
      But when I deploy the program with "windeployqt" command the images don´t work.
      Code of the spash screen:

      QSplashScreen * splashScreen = new QSplashScreen;
          splashScreen->setPixmap(QPixmap(":/images/7Guard.png"));
          splashScreen->move((ScreenWidth/2)-(splashScreen->width()/2), (ScreenHeight/2)-(splashScreen->height()/2));
          splashScreen->show();
      

      In the label I choose the file "7Guard7.png" from the resources file in the pixmap proprieties of the label.

      Code of the resources files:

      <RCC>
          <qresource prefix="/images">
              <file>7Guard.png</file>
              <file>7Guard7.png</file>
          </qresource>
      </RCC>
      
      m.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by
      #2

      Hi @Samega7Cattac

      The png files are part of the exe file of your program. So, if the png files are not part of the deployed program they were very probably already absent during the build of the release version, before the call to windeployqt.

      What happens when you run the release version "outside of Qt"?

      -Michael.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Samega7Cattac
        wrote on last edited by Samega7Cattac
        #3

        @m.sue
        If I try to run the release version outside the Qt it will crash saying:

        This application failed to start because it could not find or load the Qt plataform plugin "windows"
        in "".
        
        Reinstall the application may fix the problem.
        
        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