[Qt-interest] Overlay in conflict to QPainter?

Kerstin Reinemann unimd at web.de
Tue Jul 20 12:28:11 CEST 2010


Yes, I have already tried the Overlay-Example of Qt but this example doesn't use the virtual function GLWidget::paintOverlayGL(). In that example the QPainter is rendered in the paintEvent()-routine and the context gets swapBuffered in the end... which I try to avoid.

I want my overlay planye seperated from the 3D context so that rendering to the overlay plane is non-destructive to the main plane and vice versa. But when I use the QPainter in the paintOverlayGL()-method it is not visible..

Or is there another way to draw 2D stuff in an overlay plane using the paintOverlayGL()-method?
I also tried to do this as an alternative to QPainter:

QPixmap pixmap(100, 100);
pixmap.fill(Qt::red);
QImage image = pixmap.toImage();
QImage glImage = QGLWidget::convertToGLFormat(warningImage);
glRasterPos2i(100, 100);
glDrawPixels(glImage.width(), glImage.height(), GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits());

But it doesn't work as well. I would just like to render some 2D text in my overlay plane...

-kerstin.
___________________________________________________________
GRATIS für alle WEB.DE Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de




More information about the Qt-interest-old mailing list