diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-08-14 11:27:03 -0300 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-12-03 19:49:12 +0100 |
commit | 1f62b260daa7f2f456c7297b49e5fc1011f073e5 (patch) | |
tree | 164783e6a753c70545ca61db9d24ef4ea15dd5f7 /sources/shiboken2/doc | |
parent | 0a438ec2fa02bbb0555615e518e7ea249510a5ae (diff) |
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 <renato.araujo@kdab.com>
Fixes: PYSIDE-1074
Change-Id: I3fd391ac3d839d3f8f510c6a4d4000f7d92eacff
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/doc')
-rw-r--r-- | sources/shiboken2/doc/typesystem_specifying_types.rst | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sources/shiboken2/doc/typesystem_specifying_types.rst b/sources/shiboken2/doc/typesystem_specifying_types.rst index ac1121461..2eb78335a 100644 --- a/sources/shiboken2/doc/typesystem_specifying_types.rst +++ b/sources/shiboken2/doc/typesystem_specifying_types.rst @@ -148,6 +148,7 @@ namespace-type <typesystem> <namespace-type name="..." + visible="true | auto | false" generate="yes | no" package="..." since="..." @@ -156,8 +157,16 @@ namespace-type The **name** attribute is the name of the namespace, e.g., "Qt". - The *optional* **generate** attribute is used to inform if you need to prepend - the given namespace into each generated class. Its default value is **yes**. + The *optional* **visible** attribute is used specify whether the + namespace is visible in the target language name. Its default value is + **auto**. It means that normal namespaces are visible, but inline namespaces + (as introduced in C++ 11) will not be visible. + + The detection of inline namespaces requires shiboken to be built + using LLVM 9.0. + + The *optional* **generate** is a legacy attribute. Specifying + **no** is equivalent to **visible="false"**. The **package** attribute can be used to override the package of the type system. |