View Full Version : QList with pointers item

19th October 2009, 16:07
I've a QList with pointers:

QList <MyClass *> list;

I've a worker thread that pass to the MainWindow a list with signal and slot mechanism.

When the slot on the MainWindow is finished, the list is removed on the stack.

My question is:

when the list is removed from the stack...or If I try list.clear() are the pointers deallocate or they are only disconnected from the list?!

If they are deallocated...how can I only disconnect the pointer from the list?!


19th October 2009, 16:16
no, you should destruct pointers by yourself. take a look at qDeleteAll in docs.