Details
Description
Some background; I'm working with a proprietary communication library which is written in QT/C++. Currently I'm in the process of generating PySide6 bindings for this codebase using Shiboken6.
On of the existing classes exposes a signal whenever a connection changes, which contains a Connection object, containing some metadata.
signals: void update(Connection connection);
So far so good, but when importing and using the library in my Python client, the wrong type is returned to the signal handler, suddenly this is a 'PySide6.QtCore.QMetaObject.Connection'.
If i use a different class name for the signal value, everything works as expected. To prove this behaviour, i've put together a small proof of concept, which outputs the following:
Test OK got: <ProofOfConcept.FooBar object at 0x0000019A42EFB180> .. <class 'ProofOfConcept.FooBar'> Test bug got: <PySide6.QtCore.QMetaObject.Connection object at 0x0000019A42EFB180> Traceback (most recent call last): File "c:\Users\nicoll\Downloads\bug_wrong_type_returned\installation_area\ProofOfConcept\test.py", line 12, in handle_test_bug assert(isinstance(value, Connection)) # Fails, we got PySide6.QtCore.QMetaObject.Connection ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Done
As far as I can tell, all types get generated successfully and this is not the behaviour I would expect.
I've attached both a build proof of concept (MSVC) and the source.