How can I print QTable?QTable doesn't provide function for printing.
Thanks a lot!
Printable View
How can I print QTable?QTable doesn't provide function for printing.
Thanks a lot!
You can write print code yourself, such as:
QPrinter printer(QPrinter::HighResolution);
printer.setOutputFileName("print.ps");
QPainter painter;
painter.begin(&printer);
for (int page = 0; page < numberOfPages; ++page) {
// Use the painter to draw on the page.
if (page != lastPage)
printer.newPage();
}
painter.end();
Alternatively you could build build a HTML table based on your data, put it in a QTextDocument and print that. Depending on your requirements, this may be easier or faster.
thanks a lot!!