From 316cd73be26a95c509eba613cdb65cbfa7a5c73f Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Mon, 24 Aug 2020 10:42:04 +0200 Subject: weatherinfo: fix compilation after QXmlStreamReader QStringView change Change-Id: I3115c0a6abaf2748c3bfc01655bf2eb1d0d9cd50 Reviewed-by: Lars Knoll --- examples/svg/embedded/weatherinfo/weatherinfo.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/svg/embedded/weatherinfo/weatherinfo.cpp b/examples/svg/embedded/weatherinfo/weatherinfo.cpp index bbcba4f..2da9b9f 100644 --- a/examples/svg/embedded/weatherinfo/weatherinfo.cpp +++ b/examples/svg/embedded/weatherinfo/weatherinfo.cpp @@ -266,11 +266,11 @@ private: while (!xml.atEnd()) { xml.readNext(); if (xml.tokenType() == QXmlStreamReader::StartElement) { - if (xml.name() == "location") { + if (xml.name() == u"location") { while (!xml.atEnd()) { xml.readNext(); if (xml.tokenType() == QXmlStreamReader::StartElement) { - if (xml.name() == "name") { + if (xml.name() == u"name") { city = xml.readElementText(); m_cityItem->setPlainText(city); setWindowTitle(city); @@ -279,22 +279,22 @@ private: } } } - } else if (xml.name() == "credit") { + } else if (xml.name() == u"credit") { while (!xml.atEnd()) { xml.readNext(); if (xml.tokenType() == QXmlStreamReader::StartElement) { - if (xml.name() == "link") { + if (xml.name() == u"link") { m_copyright->setHtml(QString("%1 (source)").arg(GET_DATA_ATTR("text")).arg(GET_DATA_ATTR("url"))); xml.skipCurrentElement(); break; } } } - } else if (xml.name() == "tabular") { + } else if (xml.name() == u"tabular") { while (!xml.atEnd()) { xml.readNext(); if (xml.tokenType() == QXmlStreamReader::StartElement) { - if (xml.name() == "time") { + if (xml.name() == u"time") { if (!foundCurrentForecast) { QString temperature; QString symbol; @@ -315,7 +315,7 @@ private: } } } - } else if (xml.name() != "weatherdata" && xml.name() != "forecast" && xml.name() != "credit"){ + } else if (xml.name() != u"weatherdata" && xml.name() != u"forecast" && xml.name() != u"credit"){ xml.skipCurrentElement(); } } @@ -354,7 +354,7 @@ private: while (!xml.atEnd()) { xml.readNext(); if (xml.tokenType() == QXmlStreamReader::StartElement) { - if (xml.name() == "time") { + if (xml.name() == u"time") { QString period = GET_DATA_ATTR("period"); // save data if new day starts if (period == "0") { @@ -418,14 +418,14 @@ private: while (!xml.atEnd()) { xml.readNext(); if (xml.tokenType() == QXmlStreamReader::StartElement) { - if (xml.name() == "symbol") { + if (xml.name() == u"symbol") { QString condition = GET_DATA_ATTR("name"); symbol = extractIcon(condition); if (m_conditionItem->toPlainText().isEmpty()) m_conditionItem->setPlainText(condition); foundIcon = true; } - if (xml.name() == "temperature") { + if (xml.name() == u"temperature") { temp = GET_DATA_ATTR("value"); foundTemp = true; } -- cgit v1.2.1