View Full Version : how to print QTable?
coralbird
28th March 2007, 07:23
How can I print QTable?QTable doesn't provide function for printing.
Thanks a lot!
zeki709
28th March 2007, 15:36
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();
Jimmy2775
28th March 2007, 17:52
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.
coralbird
30th March 2007, 05:05
thanks a lot!!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.