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 know Qt philosophy is to avoid C-style memory management. How do I delete
this QList
?
QList<T> is one of Qt's generic container classes. It stores items in a list that provides fast index-based access and index-based insertions and removals.
You could use qDeleteAll:
qDeleteAll(lstMdls);
lstMdls.clear();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With