I have came up with the following solution:
QWebFrame *webFrame = webView_->page()->mainFrame();
webFrame->setScrollBarPolicy(Qt::Vertical, Qt:

crollBarAlwaysOff);
webFrame->setScrollBarPolicy(Qt::Horizontal, Qt:

crollBarAlwaysOff);
webView_->setGeometry(QRect(QPoint(0, 0), webFrame->contentsSize()));
return QPixmap::grabWidget(webView_).toImage();
which does what it should, but this code should be run only from the GUI thread, otherwise I get warnings since QPixmap cannot be used in other threads. This raises another question: Is there a way to use QPixmap outside the GUI thread ? I need to do so since my application needs to handle different document formats among which CHM, so that some pages (in this case HTML files) are loaded in a worker thread.