Hello All
I need to print out an html and I am trying something to the effect below.
I am doing anything wrong.


Qt Code:
  1. QString html;
  2. html+= "<b>Hello</b> <i>Qt!</i>";
  3.  
  4. QPrinter printer(QPrinter::HighResolution);
  5. QPrintDialog printDialog(&printer, this);
  6. if (printDialog.exec()) {
  7. QPainter painter(&printer);
  8. QTextDocument textDocument;
  9.  
  10. textDocument.setHtml(html);
  11. textDocument.print(&printer);
  12. }
To copy to clipboard, switch view to plain text mode 
JB