I need to print an entire table with the table grid. Render only gives the visible part of the table. It will also have to cross multiple pages. It's a table with approximately 360 lines. As a separate issue I also need to be able to copy it to the clipboard but one thing at a time. Right now my focus is on printing the darn thing. ( I kept it clean). I wouldn't mind putting it in a double "for" loop and pull out the data as long as the printed copy is in a table format WITH the grid lines.
QPrinter printer(QPrinter::HighResolution);
QPrintDialog dlg_Print(&printer,this);
dlg_Print.exec();
QPainter painter;
painter.begin(&printer);
double xscale = printer.pageRect().width()/double(ui.m_tbl_AvailableHeaders->width());
double yscale = printer.pageRect().height()/double(ui.m_tbl_AvailableHeaders->height());
double scale = qMin(xscale,yscale);
painter.translate(printer.paperRect().x() + printer.pageRect().width()/2,
printer.paperRect().y() + printer.pageRect().height()/2);
painter.scale(scale,scale);
painter.translate(-width()/2,-height()/2);
ui.m_tbl_AvailableHeaders->render(&painter);
Thanks for any help anyone out there can give me.
Tony
Bookmarks