QDataStream: fix compilation with QT_DISABLE_DEPRECATED_BEFORE=0x0050F00
Fixes: QTBUG-81023 Change-Id: I0d56785d1fed2c4c8e0e87ccefb0b72b0ed3644a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>bb10
parent
114394702b
commit
4bc9e3b847
|
|
@ -285,6 +285,13 @@ QDataStream &readListBasedContainer(QDataStream &s, Container &c)
|
|||
return s;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct MultiContainer { using type = T; };
|
||||
template <typename K, typename V>
|
||||
struct MultiContainer<QMap<K, V>> { using type = QMultiMap<K, V>; };
|
||||
template <typename K, typename V>
|
||||
struct MultiContainer<QHash<K, V>> { using type = QMultiHash<K, V>; };
|
||||
|
||||
template <typename Container>
|
||||
QDataStream &readAssociativeContainer(QDataStream &s, Container &c)
|
||||
{
|
||||
|
|
@ -301,10 +308,7 @@ QDataStream &readAssociativeContainer(QDataStream &s, Container &c)
|
|||
c.clear();
|
||||
break;
|
||||
}
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
c.insertMulti(k, t);
|
||||
QT_WARNING_POP
|
||||
static_cast<typename MultiContainer<Container>::type &>(c).insert(k, t);
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
|
|||
Loading…
Reference in New Issue