summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2020-08-12 11:58:54 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2020-08-19 19:48:03 +0200
commita8028a02df32355f4df4c036dbb82e9f8e8d527f (patch)
treeca5ae77f5de57a7828a526d85e702e053b63e727 /src/tools
parenta2cec17407b83aed23b01065f4e10d32008552e1 (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 'src/tools')
-rw-r--r--src/tools/qvkgen/qvkgen.cpp4
-rw-r--r--src/tools/uic/uic.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/qvkgen/qvkgen.cpp b/src/tools/qvkgen/qvkgen.cpp
index efbe54e0a5..0664f6f5db 100644
--- a/src/tools/qvkgen/qvkgen.cpp
+++ b/src/tools/qvkgen/qvkgen.cpp
@@ -104,7 +104,7 @@ void VkSpecParser::parseCommands()
m_reader.readNext();
if (m_reader.isEndElement() && m_reader.name() == QStringLiteral("commands"))
return;
- if (m_reader.isStartElement() && m_reader.name() == "command")
+ if (m_reader.isStartElement() && m_reader.name() == u"command")
m_commands.append(parseCommand());
}
}
@@ -162,7 +162,7 @@ VkSpecParser::TypedName VkSpecParser::parseParamOrProto(const QString &tag)
skip();
}
} else {
- QStringRef text = m_reader.text().trimmed();
+ auto text = m_reader.text().trimmed();
if (!text.isEmpty()) {
if (text.startsWith(QLatin1Char('['))) {
t.typeSuffix += text;
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp
index 5b2a602e5f..3601280144 100644
--- a/src/tools/uic/uic.cpp
+++ b/src/tools/uic/uic.cpp
@@ -172,7 +172,7 @@ static double versionFromUiAttribute(QXmlStreamReader &reader)
const QString versionAttribute = QLatin1String("version");
if (!attributes.hasAttribute(versionAttribute))
return 4.0;
- const QStringRef version = attributes.value(versionAttribute);
+ const QStringView version = attributes.value(versionAttribute);
return version.toDouble();
}