From d6e9076891ed06d404f9c2d7a1ffa8ecad215276 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Jul 2018 17:54:06 -0700 Subject: [PATCH] moc: align and use newlines in the generated staticMetaObjects Change-Id: Id59bdd8f1a804b809e22fffd154078f047078d70 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/tools/moc/generator.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index d299cdad51..aa02fc0af5 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -523,29 +523,29 @@ void Generator::generateCode() // Finally create and initialize the static meta object // if (isQt) - fprintf(out, "QT_INIT_METAOBJECT const QMetaObject QObject::staticQtMetaObject = {\n"); + fprintf(out, "QT_INIT_METAOBJECT const QMetaObject QObject::staticQtMetaObject = { {\n"); 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) - fprintf(out, " { nullptr, "); + fprintf(out, " nullptr,\n"); else if (cdef->superclassList.size() && (!cdef->hasQGadget || knownGadgets.contains(purestSuperClass))) - fprintf(out, " { &%s::staticMetaObject, ", purestSuperClass.constData()); + fprintf(out, " &%s::staticMetaObject,\n", purestSuperClass.constData()); else - fprintf(out, " { nullptr, "); - fprintf(out, "qt_meta_stringdata_%s.data,\n" - " qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(), + fprintf(out, " nullptr,\n"); + fprintf(out, " qt_meta_stringdata_%s.data,\n" + " qt_meta_data_%s,\n", qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData()); if (hasStaticMetaCall) - fprintf(out, " qt_static_metacall, "); + fprintf(out, " qt_static_metacall,\n"); else - fprintf(out, " nullptr, "); + fprintf(out, " nullptr,\n"); if (extraList.isEmpty()) - fprintf(out, "nullptr, "); + fprintf(out, " nullptr,\n"); else - fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData()); - fprintf(out, "nullptr}\n};\n\n"); + fprintf(out, " qt_meta_extradata_%s,\n", qualifiedClassNameIdentifier.constData()); + fprintf(out, " nullptr\n} };\n\n"); if(isQt) return;