diff options
author | David Faure <david.faure@kdab.com> | 2020-11-06 20:13:09 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2020-11-07 11:13:11 +0100 |
commit | c1d4fcb4648fec3396081d24280fbd6cfb9adb4d (patch) | |
tree | 26b347a1a69afd02794763f2949d74ff9605b469 | |
parent | 6e54f59fd7b811c820f54987f77c1d18b81b703c (diff) |
Fix misuses of the implicit QChar(int) constructor
None of these cases intended to end up calling it, which proves that
making it explicit (as will soon be the case) is a good idea.
Change-Id: Ie60e85b554df956fd19bf86517945feac9f44b32
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-rw-r--r-- | tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp | 4 | ||||
-rw-r--r-- | tests/auto/shared/qqmljsastdumper.cpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index c62ad3ebc4..0c082ed0e7 100644 --- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp +++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -968,7 +968,7 @@ void tst_qquickvisualdatamodel::packagesDestroyed() { QStringList list; for (int i=0; i<30; i++) - list << (QLatin1String("item ") + i); + list << (QLatin1String("item ") + QString::number(i)); SingleRoleModel model(list); QQuickView view; @@ -1052,7 +1052,7 @@ void tst_qquickvisualdatamodel::qaimRowsMoved() QStringList list; for (int i=0; i<30; i++) - list << (QLatin1String("item ") + i); + list << (QLatin1String("item ") + QString::number(i)); SingleRoleModel model(list); engine.rootContext()->setContextProperty("myModel", &model); diff --git a/tests/auto/shared/qqmljsastdumper.cpp b/tests/auto/shared/qqmljsastdumper.cpp index 83560f48c2..9573e9bec1 100644 --- a/tests/auto/shared/qqmljsastdumper.cpp +++ b/tests/auto/shared/qqmljsastdumper.cpp @@ -248,13 +248,14 @@ bool AstDumper::visit(UiImport *el) } bool AstDumper::visit(UiPublicMember *el) { + auto boolToStr = [](bool b) { return b ? "true" : "false"; }; QString typeStr = ((el->type == UiPublicMember::Signal) ? QLatin1String("Signal") : - (el->type == UiPublicMember::Property) ? QLatin1String("Property") : QLatin1String("Unexpected(%1)").arg(el->type)); + (el->type == UiPublicMember::Property) ? QLatin1String("Property") : QStringLiteral("Unexpected(%1)").arg(el->type)); start(QLatin1String("UiPublicMember type=%1 typeModifier=%2 name=%3 isDefaultMember=%4 isReadonlyMember=%5 isRequired=%6 " "defaultToken=%7 readonlyToken=%8 propertyToken=%9 requiredToken=%10 typeModifierToken=%11 typeToken=%12 " "identifierToken=%13 colonToken=%14 semicolonToken=%15") .arg(qs(typeStr), qs(el->typeModifier), qs(el->name), - el->isDefaultMember, el->isReadonlyMember, el->isRequired, + boolToStr(el->isDefaultMember), boolToStr(el->isReadonlyMember), boolToStr(el->isRequired), loc(el->defaultToken), loc(el->readonlyToken), loc(el->propertyToken), loc(el->requiredToken), loc(el->typeModifierToken), loc(el->typeToken), loc(el->identifierToken), loc(el->colonToken), loc(el->semicolonToken) |