diff options
author | Marco Benelli <marco.benelli@theqtcompany.com> | 2016-01-05 13:55:21 +0100 |
---|---|---|
committer | Marco Benelli <marco.benelli@theqtcompany.com> | 2016-01-05 14:16:26 +0000 |
commit | e0f2dc77b04abc9165ccd618b8ec0e55b8caf96b (patch) | |
tree | d58f4f9f51319e56941c0b2d71f089ef44ecd009 /src/libs/languageutils/fakemetaobject.cpp | |
parent | 8db4aed9455b99e5bf658dcfde67f65d535acfab (diff) |
QmlCodeModel: fix FakeMetaObject::toString .
FakeMetaObject::describe and FakeMetaProperty::describe used to print
booleans as '000' and '001'. Now they are printed as 'true' and
'false'.
Change-Id: I1deb6e614d062146989a9acf10a20a1f7ce48560
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/libs/languageutils/fakemetaobject.cpp')
-rw-r--r-- | src/libs/languageutils/fakemetaobject.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libs/languageutils/fakemetaobject.cpp b/src/libs/languageutils/fakemetaobject.cpp index bf9c5c2bcc..f4e20d57b6 100644 --- a/src/libs/languageutils/fakemetaobject.cpp +++ b/src/libs/languageutils/fakemetaobject.cpp @@ -261,6 +261,7 @@ void FakeMetaProperty::addToHash(QCryptographicHash &hash) const QString FakeMetaProperty::describe(int baseIndent) const { + auto boolStr = [] (bool v) { return v ? QLatin1String("true") : QLatin1String("false"); }; QString newLine = QString::fromLatin1("\n") + QString::fromLatin1(" ").repeated(baseIndent); QString res = QLatin1String("Property {"); res += newLine; @@ -274,13 +275,13 @@ QString FakeMetaProperty::describe(int baseIndent) const res += QString::number(revision()); res += newLine; res += QLatin1String(" isList:"); - res += isList(); + res += boolStr(isList()); res += newLine; res += QLatin1String(" isPointer:"); - res += isPointer(); + res += boolStr(isPointer()); res += newLine; res += QLatin1String(" isWritable:"); - res += isWritable(); + res += boolStr(isWritable()); res += newLine; res += QLatin1Char('}'); return res; @@ -485,6 +486,7 @@ QString FakeMetaObject::describe(bool printDetails, int baseIndent) const .arg((quintptr)(void *)this, 0, 16); if (!printDetails) return res; + auto boolStr = [] (bool v) { return v ? QLatin1String("true") : QLatin1String("false"); }; QString newLine = QString::fromLatin1("\n") + QString::fromLatin1(" ").repeated(baseIndent); res += QLatin1Char('{'); res += newLine; @@ -495,13 +497,13 @@ QString FakeMetaObject::describe(bool printDetails, int baseIndent) const res += superclassName(); res += newLine; res += QLatin1String("isSingleton:"); - res += isSingleton(); + res += boolStr(isSingleton()); res += newLine; res += QLatin1String("isCreatable:"); - res += isCreatable(); + res += boolStr(isCreatable()); res += newLine; res += QLatin1String("isComposite:"); - res += isComposite(); + res += boolStr(isComposite()); res += newLine; res += QLatin1String("defaultPropertyName:"); res += defaultPropertyName(); |