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
For Gerrit Dashboard: PYSIDE-1397 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
315804,8 | Update SmartPointers conversions | 5.15 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
316441,4 | Extend SharedPtr API with std::shared_ptr | 5.15 | pyside/pyside-setup | Status: MERGED | -1 | 0 |
401171,2 | shiboken6: Allow for several smart pointer types | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
401242,2 | shiboken6: Allow for several smart pointer types | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |