Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.7.1
-
None
-
-
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
For Gerrit Dashboard: QTBUG-128295 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
588432,12 | QTextImageHandler: make sure to preserve scheme | dev | qt/qtbase | Status: MERGED | +2 | 0 |