title: Deleting all values from a QMap
body: <p>I have a QMap consist of pointers to class objects, allocated using <code>new</code>. I need to delete all these pointers. What is the proper way of doing this with QMap ? I can do it this way:</p>
  
  <pre><code>QList&lt;ClassName*&gt; allVals = map.values();
  for (QList&lt;ClassName*&gt;::iterator it = allVals.begin(), endIt = allVals.end(); it != endIt; ++it) {
      delete *it;
  }
  </code></pre>
  
  <p>But is there a better way of doing the same ?</p>