Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How can I add a QPixmap in my Qt Quick interface?
Qt 6.12 LTS is out! See what's new in the release blog

How can I add a QPixmap in my Qt Quick interface?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 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.
  • H Offline
    H Offline
    Homunkulus
    wrote on last edited by
    #1

    Hey guys,

    I have just started to program in QML. Before I have only used QWidgets and other stuff like that. But now I want to use QML for my interface. Unfortunately there I have a bigger problem.
    The program works this way that the user choose a folder in which images are stored. This images will be used as icons and to display one of them as a bigger picture. For that I search the images and create QPixmaps. Then I resize them and save those in my database because I don't want that the pc has to do that task all the time even if the user want to see the same images. Now I wanted to show those icons and images in my interface but I don't know how.

    Do you have any idea how I can fix the problem?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      You can have look at QQuickImageProvider class and related examples. This should help you pass the PixMap to QML.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      1 Reply Last reply
      6
      • H Offline
        H Offline
        Homunkulus
        wrote on last edited by
        #3

        At first I thought same. But this function only works with Strings which I don't want to use because they haven't have the information which the QPixmap have. I already changed the size of the QPixmaps and I want to use those.

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
          wrote on last edited by
          #4

          What are the other parameters you have with Pixmap ? You can elaborate on what other things you would like to pass along with pixmap.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          https://www.pthinks.com

          1 Reply Last reply
          4
          • H Offline
            H Offline
            Homunkulus
            wrote on last edited by
            #5

            what do you mean by that?

            1 Reply Last reply
            0
            • dheerendraD Offline
              dheerendraD Offline
              dheerendra
              Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
              wrote on last edited by dheerendra
              #6

              I don't want to use because they haven't have the information which the QPixmap >have. I already changed the size of the QPixmaps and I want to use those.

              Which information you are talking above w.r.t PixMap ?
              There is not problem even if you change the size. What is the difficulty you have here ?

              Dheerendra
              @Community Service
              Certified Qt Specialist
              https://www.pthinks.com

              1 Reply Last reply
              4

              • Login

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