1、QObject派生类对象一定要标明parent
2、非QObject派生类对象,在文档没有特别要求的情况下,new 和 delete必须成对出现
非QObject派生类对象,new和delete成对出现, 这是保证内存不泄漏的基本准则,但QT中有许多特列,比如:
void QCoreApplication::postEvent ( QObject * receiver, QEvent * event, int priority ) [static]
The event must be allocated on the heap since the post event queue will take ownership of the event and delete it once it has been posted. It is not safe to access the event after it has been posted.
所以一定要看明文档