Re: TypeError: QImage.sizeInBytes() is a private method

Phil Thompson <[email protected]> Fri, 22 May 2020 14:16:45 +0100
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <[email protected]>
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