title: Qt- Qlist checking contains with Custom class
body: <p>Is there a way to override the comparing mechanism of Qt QList loaded with custom classes. </p>
  
  <p>i.e In java you just have to override a compare method. </p>
  
  <p>I am having a QList with my customclass model. </p>
  
  <pre><code>QList &lt;CustomClass *&gt;list;
  CustomClass *c1=new CustomClass();
  c1.name= "john";
  list.append(c2); 
  CustomClass *c2=new CustomClass();
  c2.name= "john";
  
  qDebug()&lt;&lt;list.contains(c2);  //false
  
  //Secondly I have overridden the equals '==' operator and still getting false
  qDebug()&lt;&lt; (c1 == c2); //false, why ? 
  qDebug()&lt;&lt; (c1-&gt;operator ==(*c2)); //true
  
  class CustomClass
  {
  QString name;
   bool operator==(const CustomClass&amp; other)const
  {
      if(this-&gt;name==(other.name))
      {
          return true;
      }
      return false;
  }
  }
  </code></pre>