diff options
author | hjk <hjk@qt.io> | 2019-07-24 13:43:54 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-07-29 08:54:18 +0000 |
commit | e3b1106afae5de6cd54ce627a0b11be041624591 (patch) | |
tree | accfac6791013e79476650b6dd840d5cf243e12b /src/plugins/scxmleditor | |
parent | 02e224fcfa7135f1e32adb02a14426ea153ae618 (diff) |
Compile fix with recent Qt dev
The reasoning in 1b4766e26c6b did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.
Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/scxmleditor')
-rw-r--r-- | src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp | 20 | ||||
-rw-r--r-- | src/plugins/scxmleditor/plugin_interface/scxmltag.cpp | 5 |
2 files changed, 9 insertions, 16 deletions
diff --git a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp index 4b7d61175ca..033a6fbe1f0 100644 --- a/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp +++ b/src/plugins/scxmleditor/plugin_interface/scxmldocument.cpp @@ -133,17 +133,15 @@ void ScxmlDocument::addNamespace(ScxmlNamespace *ns) ScxmlTag *scxmlTag = scxmlRootTag(); if (scxmlTag) { - QMapIterator<QString, ScxmlNamespace*> i(m_namespaces); - while (i.hasNext()) { - i.next(); - QString prefix = i.value()->prefix(); + for (ScxmlNamespace *ns : qAsConst(m_namespaces)) { + QString prefix = ns->prefix(); if (prefix.isEmpty()) prefix = "xmlns"; if (prefix.startsWith("xmlns")) - scxmlTag->setAttribute(prefix, i.value()->name()); + scxmlTag->setAttribute(prefix, ns->name()); else - scxmlTag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), i.value()->name()); + scxmlTag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), ns->name()); } } } @@ -172,17 +170,15 @@ bool ScxmlDocument::generateSCXML(QIODevice *io, ScxmlTag *tag) const ScxmlTag *ScxmlDocument::createScxmlTag() { auto tag = new ScxmlTag(Scxml, this); - QMapIterator<QString, ScxmlNamespace*> i(m_namespaces); - while (i.hasNext()) { - i.next(); - QString prefix = i.value()->prefix(); + for (ScxmlNamespace *ns : m_namespaces) { + QString prefix = ns->prefix(); if (prefix.isEmpty()) prefix = "xmlns"; if (prefix.startsWith("xmlns")) - tag->setAttribute(prefix, i.value()->name()); + tag->setAttribute(prefix, ns->name()); else - tag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), i.value()->name()); + tag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), ns->name()); } return tag; } diff --git a/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp b/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp index f44ca314b67..b037fb9bb98 100644 --- a/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp +++ b/src/plugins/scxmleditor/plugin_interface/scxmltag.cpp @@ -552,11 +552,8 @@ void ScxmlTag::writeXml(QXmlStreamWriter &xml) // Write editorinfo if necessary if (!m_editorInfo.isEmpty()) { xml.writeStartElement("qt:editorinfo"); - QHashIterator<QString, QString> i(m_editorInfo); - while (i.hasNext()) { - i.next(); + for (auto i = m_editorInfo.cbegin(), end = m_editorInfo.cend(); i != end; ++i) xml.writeAttribute(i.key(), i.value()); - } xml.writeEndElement(); } |