diff options
| -rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp | 2 | ||||
| -rw-r--r-- | sources/shiboken6/generator/shiboken/shibokengenerator.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp index b6c072b9b..92ffe054d 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp @@ -2544,7 +2544,7 @@ QString AbstractMetaBuilderPrivate::fixDefaultValue(const ArgumentModelItem &ite int /* argumentIndex */) const { QString expr = item->defaultValueExpression(); - if (expr.isEmpty() || expr == u"{}") + if (expr.isEmpty() || expr == u"{}" || expr == u"nullptr" || expr == u"NULL") return expr; expr.replace(u'\n', u' '); // breaks signature parser diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp index 6d5d20dcd..8f3017832 100644 --- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp +++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp @@ -382,7 +382,7 @@ QString ShibokenGenerator::guessScopeForDefaultValue(const AbstractMetaFunctionC { QString value = arg.defaultValueExpression(); - if (value.isEmpty() || value == QLatin1String("{}") + if (value.isEmpty() || value == u"{}" || value == u"nullptr" || value == u"NULL" || arg.hasModifiedDefaultValueExpression() || arg.type().isPointer()) { return value; @@ -402,7 +402,7 @@ QString ShibokenGenerator::guessScopeForDefaultValue(const AbstractMetaFunctionC } else if (arg.type().typeEntry()->isValue()) { auto metaClass = AbstractMetaClass::findClass(api().classes(), arg.type().typeEntry()); - if (enumValueRegEx.match(value).hasMatch() && value != QLatin1String("NULL")) + if (enumValueRegEx.match(value).hasMatch()) prefix = AbstractMetaBuilder::resolveScopePrefix(metaClass, value); } else if (arg.type().isPrimitive() && arg.type().name() == intT()) { if (enumValueRegEx.match(value).hasMatch() && func->implementingClass()) |
