[Qt-interest] a bug in QGraphicsScene
Yifei Li
yifli at mtu.edu
Thu Aug 19 20:04:33 CEST 2010
Samuel,
Thank you for your reply.
It's good to know that I need to restore default OpenGL states. An experiment showed that restoring default OpenGL states solves the problem.
I did surround my OpenGL code with painter.beginNativePainting() and painter.endNativePainting(). Apparently, that's not enough.
Yifei
On Aug 19, 2010, at 7:37 AM, Samuel Rødal wrote:
> On 08/18/2010 08:20 PM, ext Yifei Li wrote:
>> Bug description:
>>
>> Shapes/texts drawn using QPainterPath may not be displayed correctly if GL_DEPTH_TEST is enabled in OpenGL
>>
>> To reproduce:
>> Do OpenGL rendering in QGraphicsScene::drawBackground with depth test enabled, and then Qt 2D painting in QGraphicsScene::drawForeground()
>>
>> Platform and Qt version:
>> Qt4.6.2: this problem happened to me on Windows 7(from time to time) and MacOS(all the time).
>>
>> Qt4.5: I haven't had the problem with the same code on Windows XP.
>>
>> Yifei
>
> If you use any raw OpenGL code while a painter is active you need to surround it with painter.beginNativePainting() and painter.endNativePainting() to let the paint engine know that OpenGL state might have changed. Also, any OpenGL state that is changed should be set back to the default state.
>
> Between Qt 4.5 and Qt 4.6 the default OpenGL paint engine was changed from an OpenGL 1.x based paint engine to an OpenGL 2.x based paint engine, which explains the difference.
>
> --
> Samuel
More information about the Qt-interest-old
mailing list