aboutsummaryrefslogtreecommitdiffstats
path: root/examples/samplebinding/README.md
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-30 07:55:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-30 07:55:46 +0200
commit7af97fa4136d66bbad6c7907de6e7bd823de2e43 (patch)
tree94123be1810104d257aa50fe4b387dd8a1bf2a6c /examples/samplebinding/README.md
parent3bbcb7b0e6e0342569aa155d695bca46a7459eb0 (diff)
parentff792fd2e6842b990aff61a4e953dab5efbd89ae (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'examples/samplebinding/README.md')
-rw-r--r--examples/samplebinding/README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/samplebinding/README.md b/examples/samplebinding/README.md
index 85e96ddbe..e84d1eff4 100644
--- a/examples/samplebinding/README.md
+++ b/examples/samplebinding/README.md
@@ -62,6 +62,19 @@ and the `clone()` and `addIcecreamFlavor(Icecream*)` need additional
info about who owns the parameter objects when passing them across
language boundaries (in this case C++ will delete the objects).
+The `Truck` has getters and setters for the string `arrivalMessage`.
+In the type system file, we declare this to be a property in Python:
+
+```
+<property type="std::string" name="arrivalMessage" get="getArrivalMessage" set="setArrivalMessage"/>
+```
+
+It can then be used in a more pythonic way:
+
+```
+special_truck.arrivalMessage = "A new SPECIAL icecream truck has arrived!\n"
+```
+
After shiboken generates the C++ code and CMake makes an extension
module from the code, the types can be accessed in Python simply by
importing them using the original C++ names.