回复: MyNotePad 便签小程序
#6 [kimtaikee 09-20 10:01]
建议:你把旧版本的代码也留在那里,不要一有更新就删除原来的源码,没准有人想“节外生枝”O(∩_∩)O哈哈~
#7 [bboyfeiyu 09-20 10:37]
好东西啊 呵呵
#8 [飞风在路 09-20 20:13]
厉害,灰常给力啊
#9 [alexltr 11-01 14:08]
以下代碼可能會引起內存泄漏
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();
}
#10 [leaf- 02-06 18:11]
下来学习下,感谢。