[PyQt] QSignalSpy with bytes broken in PytQt 5.7

Phil Thompson phil at riverbankcomputing.com
Wed Aug 3 16:08:31 BST 2016


On 2 Aug 2016, at 11:33 am, Florian Bruhin <me at the-compiler.org> wrote:
> 
> This works fine and prints b'foo' as expected with PyQt 5.6 and
> Qt 5.7:
> 
>    from PyQt5.QtTest import QSignalSpy
>    from PyQt5.QtCore import QCoreApplication, QObject, pyqtSignal
> 
>    class Signaller(QObject):
>        sig = pyqtSignal(bytes)
> 
>    app = QCoreApplication([])
>    signaller = Signaller()
>    spy = QSignalSpy(signaller.sig)
>    signaller.sig.emit(b'foo')
>    print(spy[0][0])
> 
> However, with PyQt 5.7 I get None and this warning:
> 
>    QSignalSpy: Unable to handle parameter '' of type 'const char*' of
>    method 'sig', use qRegisterMetaType to register it.

Should be fixed in tonight's snpshot. Fortunately connections don't seem to be affected.

Phil


More information about the PyQt mailing list