diff options
author | Laurent Montel <laurent.montel@kdab.com> | 2019-12-03 13:42:08 +0100 |
---|---|---|
committer | Laurent Montel <laurent.montel@kdab.com> | 2019-12-05 11:57:50 +0100 |
commit | ccef2c33b284f2fd0bc08d518398af58214b020f (patch) | |
tree | 9555e9c61955fff11573c9ebdaf7bd9ab5c5bb54 /src/corelib/serialization/qdatastream.h | |
parent | d872719bf543a60108db88632d061e343e12b607 (diff) |
Fix compile with we use QT_DISABLE_DEPRECATED_BEFORE=0x060000 in apps
in qt5.15 you deprecated iterator &operator--() in qhash
but QDataStream needs it. (see writeAssociativeContainer)
So when we compile without deprecated method we can see:
qdatastream.h:333:9: error: no match for ‘operator--’ (operand type is ‘QHash<QString, QImage>::const_iterator’)
333 | --it;
| ^~~~
The current code is only
QHash<QString, QImage> m_images;
QDataStream stream(&file);
stream << m_images;
Change-Id: I12e61c0c60615455ac1eeff02969f155edb12e56
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/serialization/qdatastream.h')
-rw-r--r-- | src/corelib/serialization/qdatastream.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/serialization/qdatastream.h b/src/corelib/serialization/qdatastream.h index 332828b21e..d9d4a4fcd3 100644 --- a/src/corelib/serialization/qdatastream.h +++ b/src/corelib/serialization/qdatastream.h @@ -321,7 +321,7 @@ template <typename Container> QDataStream &writeAssociativeContainer(QDataStream &s, const Container &c) { s << quint32(c.size()); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_DEPRECATED_SINCE(5, 15) // Deserialization should occur in the reverse order. // Otherwise, value() will return the least recently inserted // value instead of the most recently inserted one. |