diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-04-13 13:55:45 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-04-26 14:34:03 +0000 |
commit | 0d12d71920067be499d9237b4ad04f7f11047759 (patch) | |
tree | 258ddf9f4b76a46f2abc656b6c725857b606c509 /sources/shiboken2/doc/typeconverters.rst | |
parent | 0b842db3a95a44fbda3379d2093cb52f8ae2a1ff (diff) |
Add references from ApiExtractor to shiboken doc
Including intersphinx extension allow us to link
the documentation from ApiExtractor to shiboken's.
ApiExtractor doc need to be build first, so we can
use the inventory that sphinx create, to link it
to shiboken's configuration.
All the harcoded references were replaced by dynamic
references. Also new labels were included to properly
cross reference topics.
Checked the spell on many rst files too.
Task-number: PYSIDE-363
Change-Id: I11a50b1f9eee48a00a3de6f957942eb0823eba47
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/doc/typeconverters.rst')
-rw-r--r-- | sources/shiboken2/doc/typeconverters.rst | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sources/shiboken2/doc/typeconverters.rst b/sources/shiboken2/doc/typeconverters.rst index ea32c7f0c..6b29bdb4f 100644 --- a/sources/shiboken2/doc/typeconverters.rst +++ b/sources/shiboken2/doc/typeconverters.rst @@ -58,22 +58,22 @@ the "<conversion-rule>" tag must be used. The details will be given later, but the gist of it are the tags -`<native-to-target>`_, which has only one conversion from C++ to Python, and -`<target-to-native>`_, that may define the conversion of multiple Python types +:ref:`native-to-target <apiextractor:native-to-target>`, which has only one conversion from C++ to Python, and +:ref:`native-to-native <apiextractor:target-to-native>`, that may define the conversion of multiple Python types to C++'s "Complex" type. .. image:: images/converter.png :height: 240px :align: center -|project| expects the code for `<native-to-target>`_, to directly return the +|project| expects the code for :ref:`native-to-target <apiextractor:native-to-target>`, to directly return the Python result of the conversion, and the added conversions inside the -`<target-to-native>`_ must attribute the Python to C++ conversion result to +:ref:`target-to-native <apiextractor:target-to-native>` must attribute the Python to C++ conversion result to the :ref:`%out <out>` variable. Expanding on the last example, if the binding developer want a Python 2-tuple of numbers to be accepted by wrapped C++ functions with "Complex" arguments, -an `<add-conversion>`_ tag and a custom check must be added. +an :ref:`add-conversion <apiextractor:add-conversion>` tag and a custom check must be added. Here's how to do it: .. code-block:: xml @@ -130,14 +130,12 @@ Here's how to do it: Container Conversions ===================== -Converters for `<container-type>`_ are pretty much the same as for other type, +Converters for :ref:`container-type <apiextractor:container-type>` are pretty much the same as for other type, except that they make use of the type system variables :ref:`%INTYPE_# <intype_n>` and :ref:`%OUTTYPE_# <outtype_n>`. |project| combines the conversion code for containers with the conversion defined (or automatically generated) for the containers. -.. _`container-type`: http://www.pyside.org/docs/apiextractor/typesystem_specifying_types.html#container-type - .. code-block:: xml <container-type name="std::map" type="map"> @@ -288,10 +286,6 @@ In this case, the parts of the implementation that will be used in the new conversion-rule are the ones in the two last method ``static inline PyObject* toPython(const Complex& cpx)`` and ``static inline Complex toCpp(PyObject* pyobj)``. The ``isConvertible`` method -is gone, and the ``checkType`` is now an attribute of the `<add-conversion>`_ +is gone, and the ``checkType`` is now an attribute of the :ref:`add-conversion <apiextractor:add-conversion>` tag. Refer back to the first example in this page and you will be able to correlate the above template with the new scheme of conversion rule definition. - -.. _`<native-to-target>`: http://www.pyside.org/docs/apiextractor/typesystem_conversionrule.html#native-to-target -.. _`<target-to-native>`: http://www.pyside.org/docs/apiextractor/typesystem_conversionrule.html#target-to-native -.. _`<add-conversion>`: http://www.pyside.org/docs/apiextractor/typesystem_conversionrule.html#add-conversion |