aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/doc
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2019-07-18 10:18:43 +0200
committerAlex Blasche <alexander.blasche@qt.io>2019-07-18 10:21:51 +0200
commit4646b8660721e5b8d06b06d714b4562e375f8c34 (patch)
treed12f0c1af2b6cdf486ff389607844a657a1b67c1 /sources/shiboken2/doc
parent97718de50e14f69048993df4e87dda1cadcc599a (diff)
parent295d9d7fb52505666a6dc9ac7b6fba2323814c48 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'sources/shiboken2/doc')
-rw-r--r--sources/shiboken2/doc/typesystemvariables.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/sources/shiboken2/doc/typesystemvariables.rst b/sources/shiboken2/doc/typesystemvariables.rst
index a07ba0d8c..b1b9bbfe6 100644
--- a/sources/shiboken2/doc/typesystemvariables.rst
+++ b/sources/shiboken2/doc/typesystemvariables.rst
@@ -126,6 +126,29 @@ Variables
Replaced by a |project| conversion call that converts a Python variable
to a C++ variable of the type indicated by ``CPPTYPE``.
+ Typically, this is a variable assignment:
+
+ .. code-block:: c++
+
+ double value = %CONVERTTOCPP[double](pyValue);
+
+ Pointer assignments are also possible:
+
+ .. code-block:: c++
+
+ void f(double *valuePtr)
+ {
+ *valuePtr = %CONVERTTOCPP[double](pyValue);
+
+ Note however, that for variable definitions, the type must
+ be a space-delimited token:
+
+ .. code-block:: c++
+
+ double * valuePtr = %CONVERTTOCPP[double](pyValue);
+
+ since it otherwise would be indistinguishable from the pointer assignment
+ above.
.. _converttopython: