Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.14.0, 5.13.2
-
None
-
I've tested on windows with Visual Studio 2015, but probably this problem is also present for other systems.
-
-
242f0fa7269e9baf331679dc413c28471b1f7d05 (pyside/pyside-setup/5.15)
Description
Wrapping classes which return shared pointers in a virtual method leads to this message
#error: CppGenerator::writeVirtualMethodNative: B::genA(): Could not find a minimal constructor for type 'QSharedPointer<A >'. This will result in a compilation error.
This is the header file which should be wrapped:
#ifndef TEST_H #define TEST_H #include <QtCore/QSharedPointer> // if uncommented, you will get the following error when calling shiboken // #error: CppGenerator::writeVirtualMethodNative: B::genA(): Could not find a minimal constructor for type 'QSharedPointer<A >'. This will result in a compilation error. #define SHIBOKEN_ERROR class A { public: int a; A(int _a); virtual ~A(); }; class B { public: int b; B(int _b); virtual ~B(); void doSomething(QSharedPointer<A> a); #ifdef SHIBOKEN_ERROR virtual #endif QSharedPointer<A> genA(); }; #endif
and this is the typesystem xml file:
<!--?xml version="1.0"?--> <typesystem package="ptest"> <load-typesystem name="typesystem_core.xml" generate="no" /> <smart-pointer-type name="QSharedPointer" type="shared" getter="data" /> <object-type name="A" /> <object-type name="B" /> </typesystem>
Attachments
Issue Links
- relates to
-
PYSIDE-454 Support shared pointers in APIs
- Closed