What would be needed to make QByteArrayList objects iterable? As the following example shows they cannot currently be iterated over.
>>> from PythonQt import QtGui >>> fmts = QtGui.QImageReader.supportedImageFormats() >>> type(fmts) <class 'PythonQt.private.QByteArrayList'> >>> fmts[0] Traceback (most recent call last): File "<console>", line 1, in <module> TypeError: 'QByteArrayList' object does not support indexing >>> iter(fmts) Traceback (most recent call last): File "<console>", line 1, in <module> TypeError: 'QByteArrayList' object is not iterable
I fixed this on the SVN trunk. It now returns a tuple containing QByteArray. To convert a QByteArray to Python str, use str(array).
Log in to post a comment.
What would be needed to make QByteArrayList objects iterable? As the following example shows they cannot currently be iterated over.
I fixed this on the SVN trunk. It now returns a tuple containing QByteArray. To convert a QByteArray to Python str, use str(array).