问题
I have a QList of pointers to objects.
QList <MyObj*> mylist;
I add to the list as follows
mylist.append(new MyObj(1));
mylist.append(new MyObj(2));
So far so good.
So for exampple if I have a MyObj object and I want to search the list for a match how do I do it?
The indexOf memeber funcion requires that I have the comparison operator for MyObj, but MyObj does not have one.
So given a MyObj object, what is the best way to see if it is contained in the list?
Regards
来源:https://stackoverflow.com/questions/7539084/removing-items-from-a-qlist-of-pointers