diff options
author | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-12-06 20:59:50 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-12-07 08:51:38 +0000 |
commit | de9a880b10bb1408626af4bef7d4e574676475e9 (patch) | |
tree | 34fdd351afb85f4958ca2bc4c90c2c8354131cac /src/lib/corelib/api/languageinfo.cpp | |
parent | b38370ed1c7b00b8f7e1ed13b882bde6c73df32f (diff) |
Print qmltypes declarations in stable (alphabetical) order.
Change-Id: I1ed67fd30b49efbbf395289846bd393e7ccc49e1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/lib/corelib/api/languageinfo.cpp')
-rw-r--r-- | src/lib/corelib/api/languageinfo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/corelib/api/languageinfo.cpp b/src/lib/corelib/api/languageinfo.cpp index c5e1cf969..e5ad395b4 100644 --- a/src/lib/corelib/api/languageinfo.cpp +++ b/src/lib/corelib/api/languageinfo.cpp @@ -52,7 +52,9 @@ QByteArray LanguageInfo::qmlTypeInfo() result.append("Module {\n"); // Individual Components: - foreach (const QString &typeName, builtins.allTypeNames()) { + auto typeNames = builtins.allTypeNames(); + typeNames.sort(); + foreach (const QString &typeName, typeNames) { QByteArray utf8TypeName = typeName.toUtf8(); result.append(" Component {\n"); result.append(QByteArray(" name: \"") + utf8TypeName + QByteArray("\"\n")); @@ -65,7 +67,12 @@ QByteArray LanguageInfo::qmlTypeInfo() Internal::ItemDeclaration itemDecl = builtins.declarationsForType(builtins.typeForName(typeName)); - foreach (const Internal::PropertyDeclaration &property, itemDecl.properties()) { + auto properties = itemDecl.properties(); + std::sort(std::begin(properties), std::end(properties), [] + (const Internal::PropertyDeclaration &a, const Internal::PropertyDeclaration &b) { + return a.name() < b.name(); + }); + foreach (const Internal::PropertyDeclaration &property, properties) { result.append(" Property { name: \""); result.append(property.name().toUtf8()); result.append("\"; "); |