diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-12 11:58:54 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-19 19:48:03 +0200 |
commit | a8028a02df32355f4df4c036dbb82e9f8e8d527f (patch) | |
tree | ca5ae77f5de57a7828a526d85e702e053b63e727 /examples/widgets | |
parent | a2cec17407b83aed23b01065f4e10d32008552e1 (diff) |
Port the QXmlStream API from QStringRef to QStringView
This gives some source incompatibilities, most of them can be
handled by using auto instead of QStringRef explicitly.
[ChangeLog][Important API changes] QXmlStream now uses QStringView
insteead of QStringRef in it's API. Using auto forvariables returning
a QStringRef in Qt 5 should lead to code that can be used against both
Qt versions.
Fixes: QTBUG-84317
Change-Id: I6df3a9507276f5d16d044a6bdbe0e4810cf99440
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'examples/widgets')
-rw-r--r-- | examples/widgets/animation/sub-attaq/graphicsscene.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.cpp b/examples/widgets/animation/sub-attaq/graphicsscene.cpp index c7e2d269c8..5248ed9f92 100644 --- a/examples/widgets/animation/sub-attaq/graphicsscene.cpp +++ b/examples/widgets/animation/sub-attaq/graphicsscene.cpp @@ -103,21 +103,21 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode, QOb while (!reader.atEnd()) { reader.readNext(); if (reader.tokenType() == QXmlStreamReader::StartElement) { - if (reader.name() == "submarine") { + if (reader.name() == u"submarine") { SubmarineDescription desc; desc.name = reader.attributes().value("name").toString(); desc.points = reader.attributes().value("points").toInt(); desc.type = reader.attributes().value("type").toInt(); submarinesData.append(desc); - } else if (reader.name() == "level") { + } else if (reader.name() == u"level") { currentLevel.id = reader.attributes().value("id").toInt(); currentLevel.name = reader.attributes().value("name").toString(); - } else if (reader.name() == "subinstance") { + } else if (reader.name() == u"subinstance") { currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toInt(), reader.attributes().value("nb").toInt())); } } else if (reader.tokenType() == QXmlStreamReader::EndElement) { - if (reader.name() == "level") { + if (reader.name() == u"level") { levelsData.insert(currentLevel.id, currentLevel); currentLevel.submarines.clear(); } |