aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/doc/typesystemvariables.rst
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-07-29 09:17:13 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-07-30 10:08:21 +0200
commit6428bb8f857ca83c244f1d021f9fae0ec3ee6b46 (patch)
tree622816d576fe4042b7b281750f8145a2c5a675d1 /sources/shiboken2/doc/typesystemvariables.rst
parent9318c09dbaa0ac78beb8edfd76a650e46e1a1b09 (diff)
parentf563bf430aeadc7b15433b28bf848fa0c68ba394 (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"
Diffstat (limited to 'sources/shiboken2/doc/typesystemvariables.rst')
-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: