summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shibokengenerator.cpp9
-rw-r--r--shibokengenerator.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index 33c5ad65..7032afdd 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -368,15 +368,16 @@ void ShibokenGenerator::writeToCppConversion(QTextStream& s, const AbstractMetaT
s << "toCpp(" << argumentName << ')';
}
-QString ShibokenGenerator::getFormatUnitString(const AbstractMetaFunction* func) const
+QString ShibokenGenerator::getFormatUnitString(const AbstractMetaFunction* func, bool incRef) const
{
QString result;
+ const char objType = (incRef ? 'O' : 'S');
foreach (const AbstractMetaArgument* arg, func->arguments()) {
if (func->argumentRemoved(arg->argumentIndex() + 1))
continue;
if (!func->typeReplaced(arg->argumentIndex() + 1).isEmpty()) {
- result += 'O';
+ result += objType;
} else if (arg->type()->isQObject()
|| arg->type()->isObject()
|| arg->type()->isValue()
@@ -384,7 +385,7 @@ QString ShibokenGenerator::getFormatUnitString(const AbstractMetaFunction* func)
|| arg->type()->isEnum()
|| arg->type()->isFlags()
|| arg->type()->isReference()) {
- result += 'O';
+ result += objType;
} else if (arg->type()->isPrimitive()) {
const PrimitiveTypeEntry* ptype = (const PrimitiveTypeEntry*) arg->type()->typeEntry();
if (ptype->basicAliasedTypeEntry())
@@ -392,7 +393,7 @@ QString ShibokenGenerator::getFormatUnitString(const AbstractMetaFunction* func)
if (m_formatUnits.contains(ptype->name()))
result += m_formatUnits[ptype->name()];
else
- result += 'O';
+ result += objType;
} else if (isCString(arg->type())) {
result += 'z';
} else {
diff --git a/shibokengenerator.h b/shibokengenerator.h
index 7c8a5d39..288acc87 100644
--- a/shibokengenerator.h
+++ b/shibokengenerator.h
@@ -278,7 +278,7 @@ public:
QString cpythonSpecialCastFunctionName(const AbstractMetaClass* metaClass);
QString getFunctionReturnType(const AbstractMetaFunction* func, Options options = NoOption) const;
- QString getFormatUnitString(const AbstractMetaFunction* func) const;
+ QString getFormatUnitString(const AbstractMetaFunction* func, bool incRef = false) const;
/// Returns the name of the macro used to export symbols
QString getApiExportMacro() const;