diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-09-30 11:10:57 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-04 13:41:08 +0200 |
commit | 228ae4b156195df49080d86a5b816952add373d8 (patch) | |
tree | cf8db307a8875da0bfda0bda9cae751e6ef721e6 /sources | |
parent | 5f3aa0bc1687c05a96772f620a97ac4135cf1b68 (diff) |
shiboken6: Document builtin primitive types
Task-number: PYSIDE-1660
Change-Id: Icd95311c99e6f0333fa58e307e71e2d886e87e3b
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken6/doc/typesystem_builtin_types.rst | 23 | ||||
-rw-r--r-- | sources/shiboken6/doc/typesystem_specifying_types.rst | 12 |
2 files changed, 29 insertions, 6 deletions
diff --git a/sources/shiboken6/doc/typesystem_builtin_types.rst b/sources/shiboken6/doc/typesystem_builtin_types.rst index fd70c5f54..ba9a576a6 100644 --- a/sources/shiboken6/doc/typesystem_builtin_types.rst +++ b/sources/shiboken6/doc/typesystem_builtin_types.rst @@ -3,6 +3,29 @@ Built-in Types -------------- +.. _primitive-cpp-types: + +Primitive C++ Types +^^^^^^^^^^^^^^^^^^^ + +Shiboken knows the C++ primitive types like int and float and gathers +information about typedefs like `int32_t` and `size_t` at runtime while +parsing C++ headers. Function overloads using these types will be +automatically generated. To suppress a primitive type, use the +:ref:`rejection` tag. + +In principle, there is no need to specify them in the typesystem +file using the :ref:`primitive-type` tag. + +However, specifying a type means that the type name is used for +matching signatures of functions for :ref:`modification <modify-function>`. +So, it might make sense to specify architecture-dependent types like `size_t` +to avoid having to spell out the resolved type, which might differ depending +on platform. + +`std::string`, `std::wstring` and their associated view types +`std::string_view`, `std::wstring_view` are also supported. + .. _cpython-types: CPython Types diff --git a/sources/shiboken6/doc/typesystem_specifying_types.rst b/sources/shiboken6/doc/typesystem_specifying_types.rst index 779ea3cf7..ade5e5aa6 100644 --- a/sources/shiboken6/doc/typesystem_specifying_types.rst +++ b/sources/shiboken6/doc/typesystem_specifying_types.rst @@ -125,7 +125,7 @@ primitive-type The ``primitive-type`` node describes how a primitive type is mapped from C++ to the target language, and is a child of the :ref:`typesystem` node. It may contain :ref:`conversion-rule` child nodes. Note that most primitives are - already specified in the QtCore typesystem. + already specified in the QtCore typesystem (see :ref:`primitive-cpp-types`). .. code-block:: xml @@ -133,16 +133,16 @@ primitive-type <primitive-type name="..." since="..." until="..." - target-name="..." + target-lang-api-name="..." default-constructor="..." preferred-conversion="yes | no" /> view-on="..." </typesystem> - The **name** attribute is the name of the primitive in C++, the optional, - **target-name** attribute is the name of the primitive type in the target - language. If the later two attributes are not specified their default value - will be the same as the **name** attribute. + The **name** attribute is the name of the primitive in C++. + + The optional **target-lang-api-name** attribute is the name of the + primitive type in the target language, defaulting to the **name** attribute. The *optional* **since** value is used to specify the API version in which the type was introduced. |