e.g QMap<SomeClass*, SomeClass*> extendedMap;

as QDeleteAll only deletes value part and not the keys. you have to specifically delete keys as well and then call clear() on it so that it will not have dangling pointers
BUT, if you are using this map to associate pointers to instances of the same class and it is a two-way map (i.e. the same pointer appears as both a key -and- a value), then you do not want to delete both the keys and the values, because then you will be double-deleting everything. Only if it is a one-way map where keys and values are pointers which appear only on one side do you want to delete both.

IMO, the easiest (and safest) way to store pointers in a QMap (or std:: map, or really any collection data structure) and guarantee that the object instances they point to will be deleted when the map is cleared is to use smart pointers, for example QSharedPointer or std:: shared_ptr. By using shared pointers, you create the object, wrap it in a shared pointer, and forget about its lifetime. No memory leaks because you called clear() instead of deleteAll(), because with smart pointers clear() has the same effect as deleteAll(). And especially if you are storing pointers in both a collection and in some other data structure, using a smart pointer will guarantee that you won't accidentally delete a pointer and leave a dangling reference somewhere else.