想做一个点击按钮more,动画的逐渐增加THIS窗口的高度,并逐渐把之前hide的THIS中的GROUP窗口显示出来的效果
void Calculator::showGrpOprator(bool istoggled)
{
QPropertyAnimation *animUi = new QPropertyAnimation(this,
"size");
if ( istoggled ) {
ui->groupBox_Operators->show();
animUi->setDuration(1000);
animUi->setStartValue(this->size());
this->resize(Width0, Height1);
animUi->setEndValue(this->size());
animUi->setEasingCurve(QEasingCurve::OutBounce);
animUi->start(QAbstractAnimation::DeleteWhenStopped);
}else {
connect(animUi, SIGNAL(finished()), ui->groupBox_Operators,
SLOT(hide()));
animUi->setDuration(1000);
animUi->setStartValue(this->size());
this->resize(Width0, Height0);
animUi->setEndValue(this->size());
animUi->setEasingCurve(QEasingCurve::OutBounce);
animUi->start(QAbstractAnimation::DeleteWhenStopped);
}
}
但是存在闪烁的问题,就是最开始已经把边框show了一下,然后窗口再从当前长度逐渐增长,同样收回的时候也会有闪烁的现象
请问有什么办法可以消除闪烁呢,得到我想要的效果?
谢谢~~~