Is it right to go through QMap using iterators and do the following: delete some elements and add new ones?
For instance:
for( QMap<key_t,val_t>::iterator it = map.begin(); it != map.end(); ++it ) { if( it->value == something ) { map.erase(it); map.insert(it->key+10,it->value); } }
It seems that nothing will be done wrong, I ask you to be sure. (I do not have enough time to check this).
UPD Solve with QMap::unite() :
for( QMap<key_t,val_t>::iterator it = map.begin(); it != map.end(); ++it ) { if( it->value == something ) { tmp_map.insert(it->key+10,it->value); map.erase(it); } } map.unite(tmp_map);
Thanks for answers!
Asten source share