如果只想清除列表内容, 而不像释放列表中指针所指的对象, 那应该用mylist.clear();
void qDeleteAll ( ForwardIterator begin, ForwardIterator end )
Deletes all the items in the range [begin, end) using the C++ delete operator. The item type must be a pointer type (for example, QWidget *).
Notice that qDeleteAll() doesn't remove the items from the container; it merely calls delete on them. In the example above, we call clear() on the container to remove the items.
This function can also be used to delete items stored in associative containers, such as QMap and QHash. Only the objects stored in each container will be deleted by this function; objects used as keys will not be deleted.