[PySide] Support for namespaces in shiboken2

info at mycontent.gr info at mycontent.gr
Wed Jan 15 19:35:42 CET 2020

Dear all,

I have a question regarding support for namespaces in shiboken2:

Is it possible to create bindings for a library whose classes are 
defined within a namespace, and if yes, what is the correct way of 
indicating this in the bindings.h / bindings.xml files?

I have tried the following (minimal example) :

namespace MyLibrary {
     namespace Core {
         class MYLIBRARY_SHARED_EXPORT MyClass {

and added "using MyLibrary::Core;" at the end of bindings.h. However, 
shiboken2 gives the following warning:

qt.shiboken: (bindings) type 'MyClass' is specified in typesystem, but 
not defined. This could potentially lead to compilation errors.

and does not generate a myclass_wrapper.cpp file; consequently the build 
fails. When I remove the namespaces, everything works fine.

Thank you for your help

Kind regards,

George Christodoulides

More information about the PySide mailing list