PDA

View Full Version : Printing a QTable



learning2fly
2nd April 2008, 22:50
Hi,
I am trying print a Qtable. Using the grabwidget way seems inadequate as the image is very small and If the table has scrollbars then the image includes the scrollbars and shows only the visible table area. Looks like it works similar to printscreen.
Is there any other way to print a QTable?
Any Suggestions will be appreciated.

current code:


QPrinter aprinter( QPrinter::HighResolution );
aprinter.setFullPage( TRUE );
if(aprinter.setup(this)
{
QTable* thetable = theApp->theTable;
QPixmap pixmap = QPixmap::grabWidget(thetable);
QPainter p;
p.begin(&aprinter);
p.drawPixmap(0,0,pixmap);
p.end();
}


Thanks,