PDA

View Full Version : new operator



QTInfinity
22nd December 2008, 11:23
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

caduel
22nd December 2008, 11:56
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