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] Images in qt application not loading.
QtWS25 Last Chance

[Solved] Images in qt application not loading.

Scheduled Pinned Locked Moved General and Desktop
24 Posts 6 Posters 28.6k 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.
  • P Offline
    P Offline
    psteranka
    wrote on last edited by
    #21

    I was running into a problem and it was as simple as running qmake and then re-building, and then viola it worked. I used

    @
    QFile testIt(":/images/mypict.jpg")
    qDebug() << "Are you loading?: " << testIt.exists();
    @

    to verify that the image was NOT loading, but I didn't know why. I searched around for answers but didn't find one that said When you add a resource, you need to re-run qmake.

    I'm posting this in case someone else has the same problem.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      psteranka
      wrote on last edited by
      #22

      I was running into a problem and it was as simple as running qmake and then re-building, and then viola it worked. I used

      @
      QFile testIt(":/images/mypict.jpg")
      qDebug() << "Are you loading?: " << testIt.exists();
      @

      to verify that the image was NOT loading, but I didn't know why. I searched around for answers but didn't find one that said When you add a resource, you need to re-run qmake.

      I'm posting this in case someone else has the same problem.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gmoney
        wrote on last edited by
        #23

        Is there any way to force Designer to use the full path of an icon by default?

        R 1 Reply Last reply
        0
        • G Gmoney

          Is there any way to force Designer to use the full path of an icon by default?

          R Offline
          R Offline
          reena jaus
          wrote on last edited by
          #24

          @Gmoney just add image to ur .qrc file in qt . and then right click on the image copy full path . then u get the correct path
          paste that to ur code .it works

          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