
Originally Posted by
ber_44
Gopala, caseInsensitiveLessThan() is a global function and cannot access class members.
If you want to access private data, you can declare the sorting function as a friend. Or better yet implement public methods in your class that do different types of comparisons and just call them from within the lessThan implementation. Something like:
bool MyLessThan(const obj &o1, const obj &o2){
return o1.isLessThan(o2, Qt::CaseInsensitive);
}
bool MyLessThan(const obj &o1, const obj &o2){
return o1.isLessThan(o2, Qt::CaseInsensitive);
}
To copy to clipboard, switch view to plain text mode
Bookmarks