QGraphicsTextItem img path in html
-
wrote on 9 Nov 2011, 10:19 last edited by
Hi,
I'm using a QGraphicsTextItem with html content. Everything works fine unless the html contains a reference to a file (e.g. <img src="myImage.png">). Then it looks like the html renderer 'root' directory is the folder containing the application. That's true on Linux or Windows but on Mac OS, it is the folder containing the application bundle and in this case, I'm a bit in trouble to get the location since there is no Qt API that gives it to me: applicationDirPath() is pointing to the 'Content/MacOS' folder on Mac.
So my questions are:- is there a way to get the 'document root' directory?
- is there a way to set the 'document root' directory to another location?
--
Dominique
-
wrote on 9 Nov 2011, 11:22 last edited by
Solved !
Actually the ‘document root’ directory is as described above but when the document() url is set it becomes this url.
i.e. QGraphicsTextItem::document()->setMetaInformation(QTextDocument::DocumentUrl, anURL)The answer to the second question is then trivial: just change the document url...
Hope that it may help...Dominique
-
wrote on 9 Nov 2011, 14:19 last edited by
bq. Solved !
actually not completely... :-(
it works as expected on Mac OS and Linux but not on Windows...
Any idea?Dominique
-
wrote on 9 Nov 2011, 15:10 last edited by
I've made additional tests and the behavior difference looks like a bug to me. Thus I'd like to:
- make a bug report. Any place to report?
- stop soliloquising :-)
--
Dominique
-
wrote on 10 Nov 2011, 06:53 last edited by
[quote author="fober" date="1320851449"]I've made additional tests and the behavior difference looks like a bug to me. Thus I'd like to:
- make a bug report. Any place to report?
- stop soliloquising :-)
--
Dominique[/quote]
For bug reports use "this":https://bugreports.qt.nokia.com
[quote]soliloquising[/quote]
-Is it Italian? Does it in English mean monologues sing- :-) ?
P.S. Oh, google translate helps me, it's soliloquies sing :-) .
Thank's for new word.
1/5