I am a step further. I figured out that the allocated memory by the float gets invalid for some reason. I do not know enough about it to say why. Maybe somebody can tell me, so I do understand more what I am doing.
What helped at least with =operator was deep copying the floats
@
MyMap &MyMap::operator=(const MyMap &rhs) {
if (this != &rhs) {
_data->_map.clear();
QMapIterator<int, QVector< const float *> > i(rhs._data->_map);
while(i.hasNext())
{
QVector< const float *> tmp = (i.next()).value();
QVector< const float *> tmp2;
QVectorIterator< const float *> j(tmp);
while(j.hasNext())
{
const float *p = j.next();
float *tmp3 = new float[3];
if(p != 0) {
mempcpy(tmp3,p, 3);
delete []p;
}
tmp2.append(tmp3);
}
_data->_map.insert(i.key(),tmp2);
}
}
}
@
I do not know if I did it right, some feedback would be great!