[Qt-interest] Best Way To Force Complete Repaint of Widget
Willy P
willy.lists at gmail.com
Mon Oct 5 23:21:22 CEST 2009
I'm encountering some pretty nasty bugs embedding widgets in OpenGL
scenes. They are not updating properly and there are some bad
blending issues with the scene behind it. However, they work
perfectly on total repaint situations, ie when you cover the widget
with another window and then show it again.
So my question is, how do I force a *total* repaint of the widget and
all it's children every time it needs to be updated? It's not a big
widget so I'm not concerned w/ the performance issues.
I've tried this, but it only sort of solves my problem:
void MyWidget::paintEvent( QPaintEvent* pe )
{
qDebug() << "painting";
if( pe->rect() != rect() ) {
pe->accept();
repaint( rect() );
} else {
QWidget::paintEvent( pe );
}
}
I say sort of, b/c it works if any child widgets are embedded in
layouts, they do not get updated.
-Willy
PS: This only seems to be a problem on Mac, Windows works fine.
More information about the Qt-interest-old
mailing list