diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-04-07 12:44:01 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-04-07 14:35:04 +0000 |
commit | 25d1bbb84939b6960f16e82254fc844839ddfa54 (patch) | |
tree | 619233c312d38b30dd4242db957b7a9c612d2fd1 /examples/widgets | |
parent | f497dea73080c2d8910bd5b6d74c9a6226db0c92 (diff) |
examples: remove some unneeded QStringRef::toString() calls
- when appending to another string
- when just comparing
- when just calling toInt()
Change-Id: I6960784569b83bfd3e3640a8c04f2f909c293449
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'examples/widgets')
-rw-r--r-- | examples/widgets/animation/sub-attaq/graphicsscene.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.cpp b/examples/widgets/animation/sub-attaq/graphicsscene.cpp index 44bd5dd12f..e0913f99f6 100644 --- a/examples/widgets/animation/sub-attaq/graphicsscene.cpp +++ b/examples/widgets/animation/sub-attaq/graphicsscene.cpp @@ -111,14 +111,15 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode) if (reader.name() == "submarine") { SubmarineDescription desc; desc.name = reader.attributes().value("name").toString(); - desc.points = reader.attributes().value("points").toString().toInt(); - desc.type = reader.attributes().value("type").toString().toInt(); + desc.points = reader.attributes().value("points").toInt(); + desc.type = reader.attributes().value("type").toInt(); submarinesData.append(desc); } else if (reader.name() == "level") { - currentLevel.id = reader.attributes().value("id").toString().toInt(); + currentLevel.id = reader.attributes().value("id").toInt(); currentLevel.name = reader.attributes().value("name").toString(); } else if (reader.name() == "subinstance") { - currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toString().toInt(), reader.attributes().value("nb").toString().toInt())); + currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toInt(), + reader.attributes().value("nb").toInt())); } } else if (reader.tokenType() == QXmlStreamReader::EndElement) { if (reader.name() == "level") { |