C++ (Qt)void qDeleteAll ( ForwardIterator begin, ForwardIterator end )void qDeleteAll ( const Container & c )Deletes all the items in the range [begin, end) using the C++ delete operator. The item type must be a pointer type ...
C++ (Qt)QList<Employee *> list;list.append(new Employee("Blackpool", "Stephen"));list.append(new Employee("Twist", "Oliver")); qDeleteAll(list.begin(), list.end());list.clear();
C++ (Qt)void qDeleteAll ( const Container & c ){ ... c.clear();}
C++ (Qt)Vector <Data*> v;v.resize (0, 99);for (int j = 0; j < 77; ++j){ for (int i = 0; i < 99; ++i) v [i] = new Data (i, j); ... //using v qDeleteAll (v);}
C++ (Qt)#define DELETE_PTR(p) (delete(p); p = NULL;)
void myDeleteAll ( const Container & c ){ qDeleteAll(c); c.clear();}
C++ (Qt)void qDeleteAll ( const Container & c )This is an overloaded function.This is the same as qDeleteAll(c.begin(), c.end()).
C++ (Qt)struct MyData { ... ~MyData( void ) {} int mType; QString * mText; ...}; void Data2Storage( QList<MyData> & src, QVector <QString *> & textStorage ){ qDeleteAll(textStorage); size_t i, limit = src.size(); textStorage.resize(limit); for (i = 0; i < limit; ++i) textStorage[i] = src[i].mText;}