Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Load image from C++ on QML
QtWS25 Last Chance

Load image from C++ on QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 600 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.
  • J Offline
    J Offline
    JANG SOONMYUN
    wrote on last edited by JANG SOONMYUN
    #1
    This post is deleted!
    KroMignonK 1 Reply Last reply
    0
    • J JANG SOONMYUN

      This post is deleted!

      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by
      #2

      @JANG-SOONMYUN said in Load image from C++ on QML:

      Please help me to solve it.

      According to your code, you called your image provider image and not ImageProvider :

      engine.addImageProvider(QLatin1String("image"), image_provider);
      

      so this should work:

      Image { source: "image://image/" + currentFrameNumber}
      

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      J 1 Reply Last reply
      1
      • KroMignonK KroMignon

        @JANG-SOONMYUN said in Load image from C++ on QML:

        Please help me to solve it.

        According to your code, you called your image provider image and not ImageProvider :

        engine.addImageProvider(QLatin1String("image"), image_provider);
        

        so this should work:

        Image { source: "image://image/" + currentFrameNumber}
        
        J Offline
        J Offline
        JANG SOONMYUN
        wrote on last edited by
        #3

        @KroMignon Thank you for reply. But it still doesn't work.

        1 Reply Last reply
        0
        • jeremy_kJ Offline
          jeremy_kJ Offline
          jeremy_k
          wrote on last edited by
          #4

          The initial example combines several possibly unrelated elements, such as the signal ImageProvider::signalNewFrameReady, QtQuick.Controls imports, and multiple uses of the image provider. The output also doesn't appear to directly correspond to the source provided, based on the messages regarding template_image.png.

          Try simplifying it to the minimum required to demonstrate the issue.

          Asking a question about code? http://eel.is/iso-c++/testcase/

          J 1 Reply Last reply
          0
          • jeremy_kJ jeremy_k

            The initial example combines several possibly unrelated elements, such as the signal ImageProvider::signalNewFrameReady, QtQuick.Controls imports, and multiple uses of the image provider. The output also doesn't appear to directly correspond to the source provided, based on the messages regarding template_image.png.

            Try simplifying it to the minimum required to demonstrate the issue.

            J Offline
            J Offline
            JANG SOONMYUN
            wrote on last edited by
            #5

            @jeremy_k Thank you for your advice. I have changed few things, but I don't know if I did it in a right way.

            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