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. QML update Image source with base64
Forum Update on Monday, May 27th 2025

QML update Image source with base64

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 1.7k 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.
  • B Offline
    B Offline
    BruceLin
    wrote on last edited by BruceLin
    #1

    Should I create custom QML object from QML Image and what I should do after?

    raven-worxR 1 Reply Last reply
    0
    • B BruceLin

      Should I create custom QML object from QML Image and what I should do after?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @BruceLin
      most generic way would probably be to implement a custom QQuickImageProvider.
      And for example then use it like this:

      Image format fixed/known:

      Image {
           source: "image://mybase64/UG9seWZvbiB....." 
      }
      

      Image format dynamic (requires parsing in the image provider implementation for the mime type):

      Image {
           source: "image://mybase64/data:image/png;base64,iVBORw0KGgoA......"
      }
      

      To be honest i am unsure if Qt will just pass the last data url (with the second colon in the path) 1:1 to your implementation, simply give it a try.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      JKSHJ 1 Reply Last reply
      2
      • raven-worxR raven-worx

        @BruceLin
        most generic way would probably be to implement a custom QQuickImageProvider.
        And for example then use it like this:

        Image format fixed/known:

        Image {
             source: "image://mybase64/UG9seWZvbiB....." 
        }
        

        Image format dynamic (requires parsing in the image provider implementation for the mime type):

        Image {
             source: "image://mybase64/data:image/png;base64,iVBORw0KGgoA......"
        }
        

        To be honest i am unsure if Qt will just pass the last data url (with the second colon in the path) 1:1 to your implementation, simply give it a try.

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @raven-worx said in QML update Image source with base64:

        Image {
             source: "image://mybase64/data:image/png;base64,iVBORw0KGgoA......"
        }
        

        No need for a custom QQuickImageProvider. QML can decode data URLs!

        Image {
            source: "data:image/png;base64,iVBORw0KGgoA......"
        }
        

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        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