I'm trying to print a QTableWidget so I create a QPixmap like this

QPixmap pixGroupe = QPixmap::grabWidget(this); // this == QTableWidget
QPrinter * printDvce = new QPrinter;
QPainter paintr(printDvce);
paintr.drawPixmap(pixGroupe);

the probleme with this code is that I can't get all the QtableWidget contents in the pixmap,
I've juste get the visible region of the table. (viewport + visible part of the headers ).

is Any one can tell what can I do to print all the content of QtableWidget ?