From 25d1bbb84939b6960f16e82254fc844839ddfa54 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 7 Apr 2017 12:44:01 +0200 Subject: 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 Reviewed-by: Edward Welbourne --- examples/widgets/animation/sub-attaq/graphicsscene.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples/widgets/animation') 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") { -- cgit v1.2.3