title: Remove duplicate object from QList
body: <p>I have a <code>QList&lt;MyData&gt;</code>, where <code>MyData</code> have 2 member, <code>int id</code> (unique) and <code>QString name</code>. I want to remove all duplicate entries based on <code>name</code>, and that entry must the highest <code>id</code> between other object that having the same <code>name</code>. Any suggestion of how to doing it in the fastest way? Performance is a very important factor here.</p>
  
  <p>Some of my idea after Google-ed for the whole day:</p>
  
  <ul>
  <li><code>qStableSort()</code> it based on id (descending), then loop through the <code>QList</code>, then for each entry, copy the entry to another new <code>QList</code> when the <code>name</code> is not exist on the new <code>QList</code></li>
  <li>use <code>QList::toSet</code> (which remove all duplicate entry), and provide operator==() and a qHash() implementation based on <code>name</code>, but the unique entry may not have the highest id</li>
  <li>use <code>std::list::unique</code>, but I'm not sure how it works.</li>
  </ul>