Results 1 to 14 of 14

Thread: Add images or screenshots to a html doc

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Add images or screenshots to a html doc

    QWidget::grab() to get an image of the widget
    Save the image to a temporary file (QTemporaryFile maybe)
    QUrl::fromLocalFile() to get a URL you can use in the src attribute of the img element.

    I do not know of a way to suppress the page number when using the print() convenience function.

    You will likely get a better quality result by directly rendering to a QPrinter or similar, but this is more work.

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

    guiismiti (8th February 2015)

Similar Threads

  1. Why the images from the HTML file is not loaded??
    By rleojoseph in forum Qt Programming
    Replies: 8
    Last Post: 2nd March 2011, 11:29
  2. How to use html to show overlapped images in QToolTip
    By LorenLiu in forum Qt Programming
    Replies: 0
    Last Post: 19th April 2010, 08:52
  3. GIF or MNG images for use in html for QTextBrowser
    By manojmka in forum Qt Programming
    Replies: 3
    Last Post: 2nd January 2008, 16:30
  4. Loading images in html in a QTextBrowser
    By BasicPoke in forum Newbie
    Replies: 1
    Last Post: 6th June 2007, 21:51
  5. getting images out of html
    By hijinks in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2006, 23:17

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.