[Qt-creator] Printing Html

Robert Löhning robert.loehning at nokia.com
Tue Feb 23 17:16:00 CET 2010


ext John Bull schrieb:
> Hello All!
> I tried to print html, is this not supposed to work?
> 
> Dialog::Dialog(QWidget *parent) :
>     QDialog(parent),
>     ui(new Ui::Dialog)
> {
>     ui->setupUi(this);
> 
>     QString html;
>     html+= "<b>Hello</b> <i>Qt!</i>";
> 
>         QPrinter printer(QPrinter::HighResolution);
>        QPrintDialog printDialog(&printer, this);
>        if (printDialog.exec()) {
>            QPainter painter(&printer);
>            QTextDocument textDocument;
> 
>            textDocument.setHtml(html);
>            textDocument.print(&printer);
>        }
> }
> 
> JB
> 
> 

This is not a question about Qt Creator, but about Qt itself. You can
try asking on the Qt-interest list:

http://lists.trolltech.com/mailman/listinfo/qt-interest

Or on the #qt channel on irc.freenode.net.

Regards,
Robert

-- 
Robert Löhning
Software Engineer
Nokia, Qt Development Frameworks

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori



More information about the Qt-creator-old mailing list