Feature request #7236
Composer labels rendered as HTML should allow relative links
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||16264|
I think it would be really nice if composer labels rendered as HTML allowed relative links.
The base URL could be the project's folder, so you could just have an "images" folder alongside the .qgs file and have them display with
<img src="images/myimage.jpg" />
Of course, absolute url would still be possible.
It seems it shouldn't be hard to implement, since Qt allows it :
Line 76 of qgscomposerlabel.cpp should just add the project's file location URL as a QUrl :
webPage->mainFrame()->setHtml( displayText(), *here* );
But I have no idea on how to get the project file's url from there.
Allow relative links in composer labels
Now labels and HTML boxes can contain relative URLs. If we don't have
a base URL, the project file will be used as a base URL (closes #7236).
Remove the exception for the labels where the images where not
loaded (unless in in PDF or image mode). It was because of a crash. Qt didn't
like having the HTML loading to be done synchronously during painting.
Fix a leak when rendering labels.