16,224
社区成员
发帖
与我相关
我的任务
分享
typedef struct _test
{
_test() : img(0) {}
~_test() { if (img) delete img;}
int id;
QString name;
QImage* img;
}Por_test;
这样在你qDeleteAll(slist);的时候,img也会被delete掉。
另外,struct就是class,你就直接用class吧