Need help with serialization of QMaps
Hi,
I try to serialize the member variable QMap <int, QByteArray> in an overloaded operator function, but I get the following compiler errror: no match for 'operator<<' in 'ds << map'
This is my overloaded operator function
Code:
QDataStream& operator<<(QDataStream& ds, const NetShmMessage & msg )
{
QMap<int, QByteArray> map;
ds << map;
return ds;
}
In my main I'm calling
msgNet is an instance of NetShmMessage wich is holding the map.
If I'm calling stream << map (with previos data definitions) in the main it is working, but not from the overloaded operator. What am I missing?
The overloaded operator is defined as global with friend prefix.
Any help would be really appreciated.
Re: Need help with serialization of QMaps
Do you have appropriate includes? QMap, QDataStream..