c++qtqvector

clean correctly a QVector


I have a QVector

QVector<const ClassA*> list; 

and I want to know how it is what the best way to clean an QVector in this case.

ClassA is not a QObject.


Solution

  • Here it is in two lines of code:

    while (list.count())
         delete list.takeLast();