Assuming you use Qt4, try QMutableMapIterator instead.
(With the 'classic' STL style iterator you will get dangling iterators if you remove the item an iterator points to. Java style iterators are easier to use (correctly) imo.)

HTH