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. how to embed a image in the exe
Forum Updated to NodeBB v4.3 + New Features

how to embed a image in the exe

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.6k 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.
  • ManiRonM Offline
    ManiRonM Offline
    ManiRon
    wrote on last edited by
    #1

    I want to embed the image in my QT application but i dont want the image source to be placed with the exe . I tried with QRC in which i added the picture and i removed the source from the destination and i cleaned my project and builded it i was getting an error " :-1: error: [debug/qrc_resource.cpp] Error 1 " . how can we do this ?

    ManiRonM 1 Reply Last reply
    0
    • ManiRonM ManiRon

      I want to embed the image in my QT application but i dont want the image source to be placed with the exe . I tried with QRC in which i added the picture and i removed the source from the destination and i cleaned my project and builded it i was getting an error " :-1: error: [debug/qrc_resource.cpp] Error 1 " . how can we do this ?

      ManiRonM Offline
      ManiRonM Offline
      ManiRon
      wrote on last edited by
      #2

      @ManiRon how to add the resource image for the background image of the mainwindow

      JonBJ 1 Reply Last reply
      0
      • ManiRonM ManiRon

        @ManiRon how to add the resource image for the background image of the mainwindow

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @ManiRon
        For your first post/question: read through https://doc.qt.io/qt-5/resources.html. That explains what your options are wrt supplying the image in a separate file (and where), or having Qt compile the image directly into the .exe so you don't have to supply an external file at all. Pick whichever appropriate approach you desire.

        1 Reply Last reply
        4
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #4

          I often convert the image data to a large const array and build the image from the array. Of course it's extremely static at that point...and the size of the image itself and format need to be considered.

          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