I come from a fairly strong C background, and have a rather solid foundation in C++. More recently I've been working with C# and other higher level languages. A project I'm looking at working on could really benefit from using QT4, but I have some questions on memory management I can't seem to understand. I've read the QT4 documentation and it hasn't helped me much. So that is why I'm here.
1) Okay so to start with, I understand that the easiest way to use QT4 objects is to declare them locally:
void MyFunc()
{
QString foo;
// do stuff to foo
}
This is simple enough, I can take that object, and pass it around and know that when it goes out of scope it will be destroyed. But here's my question.
1)If I create a QList and add objects to it, and then the QList goes out of scope, will it try to deallocate the child objects?
2)If a QT4 routine returns a pointer to an object, am I then responsible for the de-allocation of that object?
3)If I create a subclass of a QWidget, and add it to a QWindow, how do I insure that when the QWindow is destroyed, that it takes my widget with it?
Thanks for the help.