moc: align and use newlines in the generated staticMetaObjects

Change-Id: Id59bdd8f1a804b809e22fffd154078f047078d70
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Thiago Macieira 2018-07-11 17:54:06 -07:00
parent 16794e98bc
commit d6e9076891

View File

@ -523,29 +523,29 @@ void Generator::generateCode()
// Finally create and initialize the static meta object // Finally create and initialize the static meta object
// //
if (isQt) if (isQt)
fprintf(out, "QT_INIT_METAOBJECT const QMetaObject QObject::staticQtMetaObject = {\n"); fprintf(out, "QT_INIT_METAOBJECT const QMetaObject QObject::staticQtMetaObject = { {\n");
else else
fprintf(out, "QT_INIT_METAOBJECT const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData()); fprintf(out, "QT_INIT_METAOBJECT const QMetaObject %s::staticMetaObject = { {\n", cdef->qualified.constData());
if (isQObject) if (isQObject)
fprintf(out, " { nullptr, "); fprintf(out, " nullptr,\n");
else if (cdef->superclassList.size() && (!cdef->hasQGadget || knownGadgets.contains(purestSuperClass))) else if (cdef->superclassList.size() && (!cdef->hasQGadget || knownGadgets.contains(purestSuperClass)))
fprintf(out, " { &%s::staticMetaObject, ", purestSuperClass.constData()); fprintf(out, " &%s::staticMetaObject,\n", purestSuperClass.constData());
else else
fprintf(out, " { nullptr, "); fprintf(out, " nullptr,\n");
fprintf(out, "qt_meta_stringdata_%s.data,\n" fprintf(out, " qt_meta_stringdata_%s.data,\n"
" qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(), " qt_meta_data_%s,\n", qualifiedClassNameIdentifier.constData(),
qualifiedClassNameIdentifier.constData()); qualifiedClassNameIdentifier.constData());
if (hasStaticMetaCall) if (hasStaticMetaCall)
fprintf(out, " qt_static_metacall, "); fprintf(out, " qt_static_metacall,\n");
else else
fprintf(out, " nullptr, "); fprintf(out, " nullptr,\n");
if (extraList.isEmpty()) if (extraList.isEmpty())
fprintf(out, "nullptr, "); fprintf(out, " nullptr,\n");
else else
fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData()); fprintf(out, " qt_meta_extradata_%s,\n", qualifiedClassNameIdentifier.constData());
fprintf(out, "nullptr}\n};\n\n"); fprintf(out, " nullptr\n} };\n\n");
if(isQt) if(isQt)
return; return;