Results 1 to 5 of 5

Thread: Add HTML to QTextDocument with HTML containing QImage

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    104
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 7 Times in 7 Posts

    Default Re: Add HTML to QTextDocument with HTML containing QImage

    Try to save your QImage into the temporary file, then make a link to that file at your HTML code. Then print

  2. The following user says thank you to roxton for this useful post:

    Taxi (13th February 2012)

  3. #2
    Join Date
    Jul 2011
    Location
    Belgium
    Posts
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows
    Thanks
    6

    Default Re: Add HTML to QTextDocument with HTML containing QImage

    That is the last option I want to use. But I see no other way at the moment. Still thanks!

    Problem here is that if you create a QImage from a plot, and save it to a temp file, the quality sucks. If I can use the QImage itself without saving it to the harddrive, the quality will be better.
    And yes, you can change the quality of the QImage temp file to a bigger size, et cetera, BUT I'm not working here with always the same QPrinter page size. This will depent on the costumer to which type of page size he wants to print...
    Last edited by Taxi; 13th February 2012 at 17:53.

  4. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: Add HTML to QTextDocument with HTML containing QImage

    Look at the wiki article I wrote long long time ago. It should nevertheless still work: [wiki]QTextBrowser with images and CSS[/wiki]

  5. The following user says thank you to Lykurg for this useful post:

    Taxi (13th February 2012)

  6. #4
    Join Date
    Jul 2011
    Location
    Belgium
    Posts
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows
    Thanks
    6

    Default Re: Add HTML to QTextDocument with HTML containing QImage

    Thank but I'm at that point at the moment! Still, with the article you need to create an image file and reload it. Trying it not with a SVG rendered plot. Better quality :-)

Similar Threads

  1. Html used in QTextEdit and QTextDocument
    By nifei in forum Qt Programming
    Replies: 5
    Last Post: 15th August 2012, 21:38
  2. QTextDocument and HTML tags
    By naga in forum Qt Programming
    Replies: 2
    Last Post: 13th December 2011, 12:22
  3. QTextDocument QPainter html
    By aekilic in forum Qt Programming
    Replies: 6
    Last Post: 25th June 2009, 20:35
  4. QTextDocument Html URL
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 20th February 2008, 18:00
  5. QTextDocument Html
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2007, 13:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.