class MyClass { public: int a; bool operator<(const MyClass other) const { return a<other.a; } .... }; .... QList<MyClass*> list;