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.
Attachments
For Gerrit Dashboard: PYSIDE-2792 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
571130,12 | shiboken6: Refactor registerConverterName() streamable helper | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
571142,5 | shiboken6: Do not re-register a smart pointer converter under the pointee type name | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
571182,6 | shiboken6: Prevent converter name clashes between classes and partially qualified aliases | dev | pyside/pyside-setup | Status: MERGED | +2 | +1 |
573313,3 | Fix non-unity build compilation error: anystringview_helpers.h | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
573333,2 | Fix non-unity build compilation error: anystringview_helpers.h | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |