Details
Description
Attached minimal example (build it via qmake) based from scriptableapplication.
I faced strange behavior with signals with pointer and container arguments,
For testing container and signal arguments, I created an example which has a MyClass (defined in myclass.h) and passed it to different signals with different argument signatures.
MyClass has been defined in typesystem as object-type
Signals with raw pointer argument works
Signals with reference pointer works
Signals with QList<raw pointer> works
Signals with QList<MyClass> : signal is received but list is empty (think because its not value-type ?!)
Signals with QSharedPointer<MyClass> doesn't work
Signals with QList<QSharedPointer<MyClass>> doesn't work
Signals with MyClassVector ( alias of QVector<MyClass> ) doesn't work
Signals with MyClassPtrVector ( alias of QVector<MyClass*> ) doesn't work
Signals with MyClassVectorPtr ( alias of QVector<MyClass>* ) doesn't work
here is the output of application after run :
RawPointer Works <AppLib.MyClass object at 0x7f6a9f1c0ec0>
Reference Works <AppLib.MyClass object at 0x7f6a9f1c0ec0>
ListOfRawPointers Works [<AppLib.MyClass object at 0x7f6a9f1c0ec0>, <AppLib.MyClass object at 0x7f6a9f1c0ec0>]
ListOfItems Works [None]
TypeError: Can't call meta function because I have no idea how to handle QSharedPointer<MyClass>
TypeError: Can't call meta function because I have no idea how to handle QList<QSharedPointer<MyClass> >
TypeError: Can't call meta function because I have no idea how to handle MyClassVector
TypeError: Can't call meta function because I have no idea how to handle MyClassPtrVector
TypeError: Can't call meta function because I have no idea how to handle MyClassVectorPtr
Somewhere in the shiboken's code i see the warnings about typedef inside signal, is it documented anywhere?!
shiboken is able to generate codes for all test cases ( sig_* signals ) however only 3 of them actually works. Is the support limited for those three basic cases ?!
Attachments
Issue Links
- relates to
-
PYSIDE-454 Support shared pointers in APIs
- Closed
For Gerrit Dashboard: PYSIDE-2316 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
476440,4 | shiboken6: Correctly register smartpointer signatures | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
476582,2 | shiboken6: Remove check for variable type in conversion snippets | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
477194,2 | shiboken6: Remove check for variable type in conversion snippets | 6.5 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
477195,2 | shiboken6: Correctly register smartpointer signatures | 6.5 | pyside/pyside-setup | Status: MERGED | +2 | 0 |