[PyQt] QImage.constBits, constScanLine?

David Cortesi davecortesi at gmail.com
Mon Nov 5 23:44:13 GMT 2012

In the Digia docs (http://doc.qt.digia.com/qt/qimage.html) QImage is
said to have both a .bits() method and a .constBits() one, the latter
differing in that it does not perform a "deep" copy of the image data.
This might be useful if one wants to sample or process the contents of
large images.

Similarly there is supposed to be a .constScanLine to match the
.scanLine() member (although it is not clear whether a call to
.scanLine() would cause a copy of just the one line, or if it
initiates a copy of the whole image -- one hopes not!).

In the PyQt4 doc
there are "see also" references to constBits and constScanLine, but no
other mentions. Attempting to call them gets an Attribute error, so
they really aren't defined.

Should they be?

This is PyQt4.9.5 just installed on Mac OS. Using the Snow Leopard
python 2.6 if it matters.


Dave Cortesi

More information about the PyQt mailing list