[PyQt] opengl/overpainting example failing on glPushAttrib

Allen Bierbaum abierbaum at gmail.com
Tue Aug 7 22:11:29 BST 2007


I have been trying to get the overpainting and 2dpainting examples in
PyQt (examples/openg/) to work on Linux.  I am running Ubuntu 7.04
with the latest nvidia drivers.

At first I kept getting segfaults with these examples and their cpp
counterparts in the Qt 4.3 examples.  After a few hours of searching I
found that other people solved this by installing the nvidia driver
manually (directly from nvidia).  This fixed the seg faults and made
it so the cpp versions in Qt 4.3 examples work flawlessly, but I still
have a problem with the overpainting example in python (2dpainting
works fine).

When I run overpainting I get the following output:

>python overpainting.py
Traceback (most recent call last):
  File "overpainting.py", line 177, in paintEvent
    glPushAttrib(GL_ALL_ATTRIB_BITS)
OpenGL.GL.GLerror: [Errno 1281] invalid value
QPaintEngine::setSystemRect: Should not be changed while engine is active
QPaintEngine::setSystemClip: Should not be changed while engine is active
QWidget::repaint: It is dangerous to leave painters active on a widget
outside of the PaintEvent
QPaintEngine::setSystemClip: Should not be changed while engine is active
QPaintEngine::setSystemRect: Should not be changed while engine is active
QWidget::repaint: It is dangerous to leave painters active on a widget
outside of the PaintEvent
QPaintEngine::setSystemClip: Should not be changed while engine is active
QPaintEngine::setSystemRect: Should not be changed while engine is active
QPaintEngine::setSystemRect: Should not be changed while engine is active
QPaintEngine::setSystemClip: Should not be changed while engine is active
QPaintEngine::setSystemRect: Should not be changed while engine is active
QPaintEngine::setSystemClip: Should not be changed while engine is active
QWidget::repaint: It is dangerous to leave painters active on a widget
outside of the PaintEvent
QPaintEngine::setSystemClip: Should not be changed while engine is active
QPaintEngine::setSystemRect: Should not be changed while engine is active
QWidget::repaint: It is dangerous to leave painters active on a widget
outside of the PaintEvent
QPaintEngine::setSystemClip: Should not be changed while engine is active
QPaintEngine::setSystemRect: Should not be changed while engine is active
QPaintEngine::setSystemRect: Should not be changed while engine is active
QPaintEngine::setSystemClip: Should not be changed while engine is active
Traceback (most recent call last):
  File "overpainting.py", line 177, in paintEvent
    glPushAttrib(GL_ALL_ATTRIB_BITS)
OpenGL.GL.GLerror: [Errno 1281] invalid value

When I comment out all the code in paintEvent that deals with the
painter (ie. the first 3 lines and the last 5 lines), then the
application runs without errors but never displays anything.  (I am
guessing that a swap buffers call is missing somewhere)

Can anyone else confirm that this application works for them or does
anyone have any ideas why it may be failing for me?

Thanks,
Allen


More information about the PyQt mailing list