How about using the render() function?
QTableWidget t; t.render( &painter ); ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of John Bull Sent: zondag 31 januari 2010 7:24 To: [email protected] Subject: Re: [Qt-creator] export to pdf This is what I have for now. I need the actual table as it is. Any reference on how to do this would be appreciated. JB void Table::exportToPdf() { QString fileName = QFileDialog::getSaveFileName(this,tr("Export as Pdf.."),"", tr("PDF files (*.pdf)")); if (fileName.isEmpty()) return; QPrinter printer; printer.setOutputFormat(QPrinter::PdfFormat); printer.setOutputFileName(fileName); printer.setFullPage(true); printer.setOrientation(QPrinter::Portrait); printer.setPaperSize(QPrinter::A4); QPainter painter(&printer); painter.drawText(0, 0 , 250, 200,Qt::TextWordWrap,exportText ); // painter.begin() } On Sat, Jan 30, 2010 at 9:16 PM, Martin Hofius <[email protected]> wrote: Am Samstag, 30. Januar 2010 schrieb John Bull: > I have a QTable widget in a simple app I'm involved in and I would like to > be able to export it to pdf as it is .? > How can I achieve this. how about "printing" it to pdf...? Martin _______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
_______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
