Hi, Guys
Could somebody give me an insight in this?
what situation one needs to instantiate a QObject using the 'new' operator and without using a new operator
Regards
QTInfinity
Hi, Guys
Could somebody give me an insight in this?
what situation one needs to instantiate a QObject using the 'new' operator and without using a new operator
Regards
QTInfinity
If the dialog should live longer than the scope exists when you create it, you must allocate it on the heap (using new).
If you pass it to some other class and that class might try to delete it, you have to allocate it on the heap, too.
HTH
QTInfinity (23rd December 2008)
Bookmarks