aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator/shiboken/cppgenerator.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-09-26 15:20:11 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-10-05 14:27:13 +0200
commita097b2b1dbf8901ab26a80c9619f679c689677a8 (patch)
tree770feaa5f99da28dd8068d268a81e0db5cd853c5 /sources/shiboken6/generator/shiboken/cppgenerator.cpp
parent8d1514a95f27199b9a8dc850752bb645bda1bb3e (diff)
shiboken6: Introduce a helper for dereferencing arguments
Task-number: PYSIDE-2065 Change-Id: I3a7136be7eaf8362afb7b84082db1da73a7cbdee Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp')
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index c447381d6..c7158c124 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -3912,10 +3912,8 @@ void CppGenerator::writeMethodCall(TextStream &s, const AbstractMetaFunctionCPtr
} else {
const int idx = arg.argumentIndex() - removedArgs;
const auto deRef = arg.type().shouldDereferenceArgument();
- QString argName;
- if (deRef > 0)
- argName += QString(deRef, u'*');
- argName += CPP_ARG + QString::number(idx);
+ QString argName = AbstractMetaType::dereferencePrefix(deRef)
+ + CPP_ARG + QString::number(idx);
userArgs.append(argName);
}
}