From 1f62b260daa7f2f456c7297b49e5fc1011f073e5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 14 Aug 2019 11:27:03 -0300 Subject: shiboken: Fix classes in hidden namespaces There was an existing functionality to hide namespaces when specifying generate="no" on namespace-type which did not work for classes. In addition, it was implemented using the generation attributes of TypeEntry. This is problematic since dependent typesystems are loaded with generate="no", which actually means that no code should be generated for them. To fix this, introduce a new "visible" attribute for namespaces which also accommodates for hiding C++ 11 inline namespaces. Some projects uses the namespaces as packagename while creating python bindings, and to avoid duplicate names they ignore the original c++ namespace. For example a class like that: namespace Qt3D { class Vector; } The namespace "Qt3D" will be used as package name so the namespace "Qt3D" should be ignored during the generation, otherwise the 'Vector' type will be represented by 'Qt3D.Qt3D.Vector' and that is not what we want. Initial-patch-by: Renato Araujo Oliveira Filho Fixes: PYSIDE-1074 Change-Id: I3fd391ac3d839d3f8f510c6a4d4000f7d92eacff Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken2/tests/libother/otherobjecttype.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sources/shiboken2/tests/libother/otherobjecttype.cpp') diff --git a/sources/shiboken2/tests/libother/otherobjecttype.cpp b/sources/shiboken2/tests/libother/otherobjecttype.cpp index ca356ce94..1f782ecd8 100644 --- a/sources/shiboken2/tests/libother/otherobjecttype.cpp +++ b/sources/shiboken2/tests/libother/otherobjecttype.cpp @@ -34,3 +34,13 @@ operator<<(Collector& collector, const OtherObjectType& obj) collector << obj.identifier()*2; return collector; } + +int OtherObjectType::enumAsInt(SampleNamespace::SomeClass::PublicScopedEnum value) +{ + return static_cast(value); +} + +int OtherObjectType::enumAsIntForInvisibleNamespace(Invisible::EnumOnNamespace value) +{ + return static_cast(value); +} -- cgit v1.2.3