[PyKDE] QGLWidget rendering problems

David Boddie david at boddie.org.uk
Thu Dec 18 01:37:01 GMT 2003


On Wed, 17 Dec 2003 16:05:01, Tom Badran <tb100 at doc.ic.ac.uk> wrote:

>  File "/home/tb100/development/wizard/src/imagedisplay.py", line 61, in
> paintGL
>     glTexImage2D(GL_TEXTURE_2D, 0, 3, tex.width(), tex.height(), 0,
> GL_RGBA, GL_UNSIGNED_BYTE, tex.bits() )
> ValueError: expect source sequence
>
> This is basically copied from the documentation of QGLWidget so i assumed
> it would work ok. I have no idea what to do, any pointers would be
> brilliant.

Working from memory, and after some experimentation, I found that the
glTexImage2D function in PyOpenGL appears to want a list of integers, at
least when supplied with the GL_UNSIGNED_BYTE constant.

Getting this sort of information from a QImage object at the Python level
appears to be difficult since there isn't an equivalent to the
QImage.loadFromData method for saving image data. Wasn't this problem
discussed on this list recently?

David




More information about the PyQt mailing list