Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-128295

QTextImageHandler findAtNxFileOrResource() strips file: scheme

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.9.0 FF
    • 6.7.1
    • GUI: Text handling
    • None
    • All
    • 9a47132b75d5c0dddcc523ab3ed648b0f80f1485

    Description

      I have subclassed QTextBrowser to override ::loadResource()

      I start my QTextBrowser with my own special URL scheme  mything://home

      This triggers my ::loadResource() to load some preset HTML content.

      The content includes <img src='file:something.png'>

      I want to load this file from disk my own special way, and I handle that in ::loadResource()

      The problem is qtextimagehandler.cpp findAtNxFileOrResource() strips the file: scheme from the URL, so by the time it reaches my ::loadResource(),

      the url is now mything://home/something.png

      ie the document context's URL path has been prepended to the stripped image URL.

       

      I have patched my QT with the attached patch, and it appears to work for me.

      When the function detects the file: scheme, it remembers and re-adds the scheme before returning the new file location.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            elegant_dice Paul
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes