diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-05 12:00:45 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-05 17:08:00 +0200 |
commit | 4a1d5f1d6cc6325c8e26512f408966821b41c480 (patch) | |
tree | c5451d0d3786ff21f89dfa2b8c464d467d8f2533 /sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | |
parent | 1eb777f3846685b366207827a9c01a874cda91c8 (diff) |
shiboken: Enable specifying names for a parameters of added functions
Introduce a way to specify a name for a parameter using '@'
delimiters.
Fixes: PYSIDE-1017
Change-Id: I3ae505c104a64413ca2bad628d9f9d3e04bb5b88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index 67489b151..170a8e1d4 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1615,11 +1615,11 @@ AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFu metaFunction->setType(translateType(addedFunc->returnType())); - QVector<AddedFunction::TypeInfo> args = addedFunc->arguments(); + const auto &args = addedFunc->arguments(); AbstractMetaArgumentList metaArguments; for (int i = 0; i < args.count(); ++i) { - AddedFunction::TypeInfo& typeInfo = args[i]; + const AddedFunction::TypeInfo& typeInfo = args.at(i).typeInfo; AbstractMetaArgument *metaArg = new AbstractMetaArgument; AbstractMetaType *type = translateType(typeInfo); if (Q_UNLIKELY(!type)) { @@ -1630,6 +1630,8 @@ AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFu return nullptr; } type->decideUsagePattern(); + if (!args.at(i).name.isEmpty()) + metaArg->setName(args.at(i).name); metaArg->setType(type); metaArg->setArgumentIndex(i); metaArg->setDefaultValueExpression(typeInfo.defaultValue); |