[Qt-interest] custom widgets and OpenGL

Tyler Daniel tyler at rosette-research.com
Sat Nov 13 13:53:21 CET 2010


> By the way, the provided example qq26-openglcanvas.zip did not run on my Windows XP with Qt 4.7.0. It turned out that the "PaintEngine" is of type QPaintEngine::OpenGL2 and not just QPaintEngine::OpenGL
> 
> So I daringly extended the test like this:
> 
> void OpenGLScene::drawBackground(QPainter *painter, const QRectF &)
> {
>  if (painter->paintEngine()->type() != QPaintEngine::OpenGL && painter->paintEngine()->type() != QPaintEngine::OpenGL2) {
>    ...
>  }
>  ...
> }
> 
> Like this the example ran perfectly.

Really?  Interesting.  I did the same thing, but on Win7 here the widgets show up without window decorations (title bar, frames).

That was going to be my next question for the list.

> Maybe a method QPaintEngine::isOpenGL() would be helpful here as well :)

I agree!

Tyler





More information about the Qt-interest-old mailing list