以下代碼可能會引起內存泄漏
connect(btnExpand,SIGNAL(clicked()),this,SLOT(doAnimation()));
connect(btnCollapse,SIGNAL(clicked()),this,SLOT(doAnimation()));
..........
void MyNotePad::doAnimation()
{
QPropertyAnimation *amt = new QPropertyAnimation(this,"geometry",this);
amt->setDuration(ANIMATION_DURATION);
QRect originalRect = this->geometry();
QRect newRect = mExpand ? QRect(mNotepadPot,COLLAPSE_SIZE) : QRect(mNotepadPot,EXPAND_SIZE);
amt->setStartValue(originalRect);
amt->setEndValue(newRect);
//amt->setEasingCurve(QEasingCurve::OutBounce);
connect(amt,SIGNAL(finished()),this,SLOT(updateVar()));
amt->start();
}