Feature request #7236
Composer labels rendered as HTML should allow relative links
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | - | ||
Pull Request or Patch supplied: | No | Resolution: | |
Easy fix?: | No | Copied to github as #: | 16264 |
Description
Hi !
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 :
http://doc.qt.digia.com/4.7/qwebview.html#setHtml
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.
Associated revisions
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.
History
#1 Updated by Patrick Valsecchi almost 9 years ago
I'm working on it.
#2 Updated by Patrick Valsecchi over 8 years ago
- Status changed from Open to Closed
Fixed in changeset f696b0a34deede45e3dc4bc3be3d818543cd89c4.