【发布时间】:2014-06-19 12:21:32
【问题描述】:
我正在尝试比较 QList 中的项目。 这是使用 QPtrCollection 的旧方法,但这不能在 qt3 之后的版本中使用(据我所知)。
class gnyComponentList:public QList<gnyComponent>
{
protected:
virtual int compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 )
{ return (((gnyComponent *)item1)->getID()).compare(((gnyComponent *)item2)->getID());}
};
我不知道在 Qt5.3 中这样做的好方法是什么?
【问题讨论】: