Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsTextItem img path in html
Forum Updated to NodeBB v4.3 + New Features

QGraphicsTextItem img path in html

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fober
    wrote on 9 Nov 2011, 10:19 last edited by
    #1

    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
    1 Reply Last reply
    0
    • F Offline
      F Offline
      fober
      wrote on 9 Nov 2011, 11:22 last edited by
      #2

      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

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fober
        wrote on 9 Nov 2011, 14:19 last edited by
        #3

        bq. Solved !

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

        Dominique

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fober
          wrote on 9 Nov 2011, 15:10 last edited by
          #4

          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
          1 Reply Last reply
          0
          • R Offline
            R Offline
            rokemoon
            wrote on 10 Nov 2011, 06:53 last edited by
            #5

            [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 Reply Last reply
            0

            1/5

            9 Nov 2011, 10:19

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved