Hi guys,


How to use qSort() if the QList contains pointers like this...
Qt Code:
  1. QList < double* > _doubleList;
  2. // this is for simple easyness , you can give QList<employee*>
  3.  
  4. _doubleList .append( new( 2.22) );
  5. _doubleList .append( new( 1.22) );
  6. _doubleList .append( new( 4.22) );
  7. _doubleList .append( new( 3.22) );
  8.  
  9. qSort( _doubleList ); // This code will not sort the data properly
To copy to clipboard, switch view to plain text mode 

while using the above "_doubleList" the data is not sorting .
But if am using the list like this ...

Qt Code:
  1. QList < double > _doubleList;
  2. // this is for simple easyness , you can give QList<employee*>
  3.  
  4. _doubleList .append( 2.22 );
  5. _doubleList .append( 1.22 );
  6. _doubleList .append( 4.22 );
  7. _doubleList .append( 3.22 );
  8.  
  9. qSort( _doubleList ); // This code WILL SORT the data properly
To copy to clipboard, switch view to plain text mode 


please tell me how to sort a QList which contains pointers.
thanks in advance