aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-12 13:17:36 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-22 13:17:27 +0200
commit5b19cf6ab082c6be5f9177925f3e3180ca02ed4c (patch)
treebf426790810ccadeafbdb2e81283d263fb18c09b /sources/shiboken6/generator
parent193769216f60f87feb20bbffa832cc159bbe525c (diff)
shiboken6: Introduce new position for code injection into virtual methods
Make it possible to inject code before the Python override is called. Task-number: PYSIDE-2602 Pick-to: 6.7 Change-Id: I0e5b4ced34ae8b41df5acdb34912b853f60b372f Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/generator')
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 35a9d1842..4ac6492e9 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -1216,6 +1216,11 @@ void CppGenerator::writeVirtualMethodNative(TextStream &s,
returnStatement.statement, true);
s << outdent << "}\n\n"; //WS
+ if (!snips.isEmpty()) {
+ writeCodeSnips(s, snips, TypeSystem::CodeSnipPositionPyOverride,
+ TypeSystem::ShellCode, func, false, lastArg);
+ }
+
writeVirtualMethodPythonOverride(s, func, snips, returnStatement);
}