Commit e3934226 authored by Nikita Baryshnikov's avatar Nikita Baryshnikov

Qml&Js: better formatting of enums inspection

Change-Id: I3d3948fcebb6b902a18fcf492122229c69c5ac3e
Reviewed-by: default avatarMarco Benelli <marco.benelli@qt.io>
parent f8e764e0
......@@ -658,8 +658,16 @@ static QString inspectCppComponent(const CppComponentValue *cppValue)
const int enumeratorCount = cppValue->metaObject()->enumeratorCount();
for (int index = cppValue->metaObject()->enumeratorOffset(); index < enumeratorCount; ++index) {
LanguageUtils::FakeMetaEnum enumerator = cppValue->metaObject()->enumerator(index);
bufWriter << " // Enum " << enumerator.name() << " { " <<
enumerator.keys().join(QLatin1Char(',')) << " }" << endl;
bufWriter << " enum " << enumerator.name() << " {" << endl;
const QStringList keys = enumerator.keys();
const int keysCount = keys.size();
for (int i = 0; i < keysCount; ++i) {
bufWriter << " " << keys.at(i);
if (i != keysCount - 1)
bufWriter << ',';
bufWriter << endl;
}
bufWriter << " }" << endl;
}
bufWriter << "}" << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment