diff options
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/generator.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index db27067cf6..c4184929ef 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1193,7 +1193,7 @@ void Generator::generateStaticMetacall() } fprintf(out, ");"); if (f.normalizedType != "void") { - fprintf(out, "\n if (_a[0]) *reinterpret_cast< %s*>(_a[0]) = _r; } ", + fprintf(out, "\n if (_a[0]) *reinterpret_cast< %s*>(_a[0]) = std::move(_r); } ", noRef(f.normalizedType).constData()); isUsed_a = true; } @@ -1506,11 +1506,7 @@ void Generator::generateSignal(FunctionDef *def,int index) fprintf(out, ")%s\n{\n", constQualifier); if (def->type.name.size() && def->normalizedType != "void") { QByteArray returnType = noRef(def->normalizedType); - if (returnType.endsWith('*')) { - fprintf(out, " %s _t0 = 0;\n", returnType.constData()); - } else { - fprintf(out, " %s _t0 = %s();\n", returnType.constData(), returnType.constData()); - } + fprintf(out, " %s _t0{};\n", returnType.constData()); } fprintf(out, " void *_a[] = { "); |