PDA

View Full Version : resize issues when rendering specific region of QWebFrame



jkelly_
30th November 2008, 16:59
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:


void MyWidget::paintEvent(QPaintEvent *ev)
{
if (!page())
return;

QPainter p(this);
// specify the region we want to paint
QRegion region(QRect(1, 1, 587, 483)); // x, y, width, height

QWebFrame *frame = page()->mainFrame();
frame->render(&p, region);
}


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