Details
Description
In an example where we have two classes:
class A {}; class B:A {}; // has 'A' as base class
Today is not possible to pass SharedPointer<B> to a function that accepts SharedPointer<A>;
Since SharedPointer<B> is not derived from SharedPointer<A> shiboken fails to covert it back to CPP;
Problem #1 is signature
RUN 1: ERROR: testSmartPointerConversions (__main__.SmartPointerTests) RUN 1: ---------------------------------------------------------------------- RUN 1: Traceback (most recent call last): RUN 1: File "sources/shiboken2/tests/smartbinding/smart_pointer_test.py", line 226, in testSmartPointerConversions RUN 1: r = o.takeSharedPtrToInteger(integer2) RUN 1: TypeError: 'smart.Obj.takeSharedPtrToInteger' called with wrong argument types: RUN 1: smart.Obj.takeSharedPtrToInteger(SharedPtr_Smart_Integer2) RUN 1: Supported signatures: RUN 1: smart.Obj.takeSharedPtrToInteger(smart.SharedPtr[smart.Integer])
Not sure if the C++ binding would work.
Attachments
Issue Links
- relates to
-
PYSIDE-454 Support shared pointers in APIs
- Closed
-
PYSIDE-1933 Shared pointer convertible to base class ONLY if directly inherits the base class
- Closed
- resulted in
-
PYSIDE-2946 Smart pointer conversion code (introduced with shiboken 6.8.x?) crashes depending on order of AddTypeCreationFunction
- Closed