summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-11-22 12:00:53 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2019-11-05 17:32:22 +0100
commitdbb54805f63f9ed68d84fe090d608872f16170d2 (patch)
treeb144940788fd969477ad29f6307a265c9aa121a0 /src/xml
parent6f8a97e480f0b1db0b3d59d74dcf6a19963de7b8 (diff)
Deprecate reverse iteration on QHash
std::unordered_map only supports forward iteration for good reasons. Align our API with this by deprecating reverse iteration and the operator+/-() for iterators. [ChangeLog][QtCore][QHash] Reverse iteration over QHash is now deprecated. [ChangeLog][Potentially Binary-Incompatible Changes] QHash's iterator category was changed from bidirectional iterator to forward iterator. This may cause trouble if a library uses the iterator category to alter functionality through tag dispatching. This only applies when compiling the library or application with QT_DISABLE_DEPRECATED_BEFORE=0x050F00 and the other with a lower value. Change-Id: I0fb6d017cabdef1bc508e62f76dc2fa73cd3652d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/dom/qdom.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index e3bf97d1a6..c71256457a 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -2648,7 +2648,7 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::item(int index) const
{
if (index >= length() || index < 0)
return nullptr;
- return *(map.constBegin() + index);
+ return *std::next(map.cbegin(), index);
}
int QDomNamedNodeMapPrivate::length() const