diff options
Diffstat (limited to 'sources/shiboken6/doc')
-rw-r--r-- | sources/shiboken6/doc/typesystem_manipulating_objects.rst | 10 | ||||
-rw-r--r-- | sources/shiboken6/doc/typesystem_specifying_types.rst | 36 |
2 files changed, 40 insertions, 6 deletions
diff --git a/sources/shiboken6/doc/typesystem_manipulating_objects.rst b/sources/shiboken6/doc/typesystem_manipulating_objects.rst index dcb3a46b1..ea8c6247c 100644 --- a/sources/shiboken6/doc/typesystem_manipulating_objects.rst +++ b/sources/shiboken6/doc/typesystem_manipulating_objects.rst @@ -78,7 +78,8 @@ modify-field <modify-field name="..." write="true | false" read="true | false" - remove="true | false" /> + remove="true | false" + snake-case="yes | no | both" /> </object-type> The ``name`` attribute is the name of the field, the *optional* ``write`` @@ -91,6 +92,8 @@ modify-field The *optional* ``rename`` attribute can be used to change the name of the given field in the generated target language API. + The *optional* **snake-case** attribute allows for overriding the value + specified on the class entry or **typesystem** element. .. _modify-function: @@ -112,7 +115,8 @@ modify-function allow-thread="true | auto | false" exception-handling="off | auto-off | auto-on | on" overload-number="number" - rename="..." /> + rename="..." + snake-case="yes | no | both" /> </object-type> The ``signature`` attribute is a normalized C++ signature, excluding return @@ -191,6 +195,8 @@ modify-function The *optional* ``access`` attribute changes the access privileges of the given function in the generated target language API. + The *optional* **snake-case** attribute allows for overriding the value + specified on the class entry or **typesystem** element. .. _add-function: diff --git a/sources/shiboken6/doc/typesystem_specifying_types.rst b/sources/shiboken6/doc/typesystem_specifying_types.rst index 405469ea2..243af9603 100644 --- a/sources/shiboken6/doc/typesystem_specifying_types.rst +++ b/sources/shiboken6/doc/typesystem_specifying_types.rst @@ -35,7 +35,8 @@ typesystem .. code-block:: xml - <typesystem package="..." default-superclass="..." allow-thread="..." exception-handling="..."> + <typesystem package="..." default-superclass="..." allow-thread="..." + exception-handling="..." snake-case="yes | no | both" > </typesystem> The **package** attribute is a string describing the package to be used, @@ -47,6 +48,22 @@ typesystem specify the default handling for the corresponding function modification (see :ref:`modify-function`). + The *optional* **snake-case** attribute specifies whether function + and field names will be automatically changed to the snake case + style that is common in Python (for example, ``snakeCase`` will be + changed to ``snake_case``). + + The value ``both`` means that the function or field will be exposed + under both its original name and the snake case version. There are + limitations to this though: + + - When overriding a virtual function of a C++ class in Python, + the snake case name must be used. + + - When static and non-static overloads of a class member function + exist (as is the case for example for ``QFileInfo::exists()``), + the snake case name must be used. + load-typesystem ^^^^^^^^^^^^^^^ @@ -280,7 +297,8 @@ value-type hash-function="..." stream="yes | no" default-constructor="..." - revision="..." /> + revision="..." + snake-case="yes | no | both" /> </typesystem> The **name** attribute is the fully qualified C++ class name, such as @@ -310,6 +328,9 @@ value-type specify the default handling for the corresponding function modification (see :ref:`modify-function`). + The *optional* **snake-case** attribute allows for overriding the value + specified on the **typesystem** element. + .. _object-type: object-type @@ -330,7 +351,8 @@ object-type exception-handling="..." hash-function="..." stream="yes | no" - revision="..." /> + revision="..." + snake-case="yes | no | both" /> </typesystem> The **name** attribute is the fully qualified C++ class name. If there is no @@ -360,6 +382,9 @@ object-type specify the default handling for the corresponding function modification (see :ref:`modify-function`). + The *optional* **snake-case** attribute allows for overriding the value + specified on the **typesystem** element. + interface-type ^^^^^^^^^^^^^^ @@ -480,7 +505,7 @@ function .. code-block:: xml <typesystem> - <function signature="..." rename="..." since="..."/> + <function signature="..." rename="..." since="..." snake-case="yes | no | both" /> </typesystem> This tag has some limitations, it doesn't support function modifications, besides you @@ -490,6 +515,9 @@ function The function tag has two *optional* attributes: **since**, whose value is used to specify the API version of this function, and **rename**, to modify the function name. + The *optional* **snake-case** attribute allows for overriding the value + specified on the **typesystem** element. + .. _system_include: system-include |