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. QML Image object, unable to load file
Forum Updated to NodeBB v4.3 + New Features

QML Image object, unable to load file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 4 Posters 501 Views 4 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.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by mrdebug
    #1

    Hi, I have a problem on load file with QML image object when the file path contains the special char #.
    How can I resolve? I can't remove this special char from the path.
    The error is

    QML Image: Cannot open: file:///Dati/Backup/Spartiti/AAA Leggio elettronico/Data/Cesi Mi+ Do#-/001.png
    

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    raven-worxR 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      It probably won't work, but you can try escaping it with \. Or (better) - use QUrl::fromLocalFile() to get a properly escaped string. Or (biggest effort but will surely work) implement an ImageProvider which will read the file and provide it to your Image component.

      (Z(:^

      1 Reply Last reply
      2
      • mrdebugM mrdebug

        Hi, I have a problem on load file with QML image object when the file path contains the special char #.
        How can I resolve? I can't remove this special char from the path.
        The error is

        QML Image: Cannot open: file:///Dati/Backup/Spartiti/AAA Leggio elettronico/Data/Cesi Mi+ Do#-/001.png
        
        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #3

        @mrdebug
        since an url is expected my guess is that it must be escaped properly (# = %23)

        --- 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

        1 Reply Last reply
        5
        • mrdebugM Offline
          mrdebugM Offline
          mrdebug
          wrote on last edited by
          #4

          Solved with

          %23
          

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

          1 Reply Last reply
          0
          • fcarneyF Offline
            fcarneyF Offline
            fcarney
            wrote on last edited by
            #5

            This might help too.
            It has this described:

            Image { source: encodeURIComponent("/tmp/test#1.png") }
            

            C++ is a perfectly valid school of magic.

            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