From b440f5a129923c3a1978d20956284a327b1ff6fe Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 29 Sep 2020 08:00:37 +0200 Subject: samplebinding: Add a sample property definition Task-number: PYSIDE-1019 Change-Id: Ieecd08c451c47951ebe05d86b0932ef2682821aa Reviewed-by: Cristian Maureira-Fredes --- examples/samplebinding/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'examples/samplebinding/README.md') 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: + +``` + +``` + +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. -- cgit v1.2.3