QGraphicsTextItem img path in html



  • 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


  • 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



  • bq. Solved !

    actually not completely... :-(
    it works as expected on Mac OS and Linux but not on Windows...
    Any idea?

    Dominique



  • 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 author="fober" date="1320851449"]I've made additional tests and the behavior difference looks like a bug to me. Thus I'd like to:

    [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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.