TypeError: QImage.sizeInBytes() is a private method
Phil Thompson
phil at riverbankcomputing.com
Fri May 22 14:16:45 BST 2020
On 22/05/2020 11:20, Florian Bruhin wrote:
> Hi again,
>
> With Qt 5.10, QImage::byteCount() got deprecated and replaced by
> QImage::sizeInBytes():
>
> https://doc.qt.io/qt-5/qimage-obsolete.html#byteCount
> https://doc.qt.io/qt-5/qimage.html#sizeInBytes
>
> However, calling it from PyQt doesn't seem to work:
>
> >>> from PyQt5.QtGui import QImage
> >>> img = QImage()
> >>> img.sizeInBytes()
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> TypeError: QImage.sizeInBytes() is a private method
>
> Not sure why this happens, as sizeInBytes() is under "public:" in
> qimage.sip...
>
> This is with Python 3.8.2, PyQt5 5.14.2, PyQt5-sip 12.7.2 and sip
> 4.19.22 on
> Archlinux.
>
> Florian
It's a code generation bug - fixed in tonight's SIP snapshot.
Thanks,
Phil
More information about the PyQt
mailing list