Hi,

I want to render a specific part of a web page when using the QWebView widget. I've created a subclass of QWebView and I've overridden the paintEvent method. The code for the paintEvent method is below:
Qt Code:
  1. void MyWidget::paintEvent(QPaintEvent *ev)
  2. {
  3. if (!page())
  4. return;
  5.  
  6. QPainter p(this);
  7. // specify the region we want to paint
  8. QRegion region(QRect(1, 1, 587, 483)); // x, y, width, height
  9.  
  10. QWebFrame *frame = page()->mainFrame();
  11. frame->render(&p, region);
  12. }
To copy to clipboard, switch view to plain text mode 

The only problem i have is that when i resize the window that contains my subclass of QWebView then i get visual artifacts. Is there something i should do after i call frame->render()?

John