diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-05-19 13:33:27 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-05-22 14:54:26 +0200 |
commit | 90243aebb653f67a3898fff2f9feec9dca2ded5d (patch) | |
tree | e77ccce878afae772f162e844487d12218b44168 /examples/widgets/painting/painting.pro | |
parent | ce211b1f837ce3212074800e92dee30d95546d94 (diff) |
QTextBrowser: set base URL and document URL before loading content
setHtml() or setMarkdown() can result in attempting to load resources
such as images that are needed to render the page. Whenever the
resource has a relative URL, loading depends on the baseURL having
already been set so that a complete URL can be constructed.
QTextDocument::resource() is called to load images, and uses baseUrl().
A little later, QTextBrowserPrivate::resolveUrl() is given an URL that
already has been extended with the baseURL if known; but it has its own
logic to resolve the resource URL against currentURL, or else to treat
it as a local file path if a file exists at that location. The autotest
was relying on this fallback to the local relative file path before; but
now it tests both with a local filename in the current directory for the
source HTML and also with a fully resolved source URL containing the
complete file path.
Also made minor style improvements in tst_QTextBrowser's TestBrowser class.
Change-Id: I46a850015d0e9c5bc5f13b9e37179a9323ab1980
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'examples/widgets/painting/painting.pro')
0 files changed, 0 insertions, 0 deletions