I have a QList with pointers to objects with class type Model. I would like to delete appropriately this QList after it has being used. I
QList
Model
You could use qDeleteAll:
qDeleteAll(lstMdls); lstMdls.clear();
As seen from an earlier revision, this was OP's approach:
QList<Model*>lstMdls; get Data(lstMdls); /* * Do other things */ for(int i=0;i<lstMlds.size();i++) { delete lstMdls.first(); }