aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-12-11 10:26:10 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-10 14:09:07 +0100
commitf597a74e3b3eb3042c7d85dc2df813852e0c3db5 (patch)
treed4dbd48827a74d19cff0d9ae90921a60866eade9 /sources/shiboken2/generator
parent48b2b106fd4aaff27ec9686a2a9911f93ef9b247 (diff)
shiboken: Add explanatory comment to getattro function
Make it clear how the dispatch works. Task-number: PYSIDE-454 Change-Id: Idd98eee5a7f7d45891c8a7dd0170f9188f136296 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 0ffb486e27996bbd81cde5f3d73b2d8346386ffb)
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 575e1364c..0c5da737c 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -5345,6 +5345,8 @@ void CppGenerator::writeGetattroFunction(QTextStream &s, GeneratorContext &conte
}
s << INDENT << "PyErr_Clear();\n";
+ // This generates the code which dispatches access to member functions
+ // and fields from the smart pointer to its pointee.
s << INDENT << "// Try to find the 'name' attribute, by retrieving the PyObject for "
"the corresponding C++ object held by the smart pointer.\n";
s << INDENT << "if (auto rawObj = PyObject_CallMethod(self, "