I have an animation that changes the size of a widget. Because it is a widget contained in a dockwidget, I grow it by changing the minimumSize then reset its minimumSize to 0,0. I use a QSequentialAnimationGroup for these two changes, however when the duration of the second animation is short, the widget does not grow all the way to specified size. It appears that the second animation starts before the first one finishes. Here is the code:
@ QSequentialAnimationGroup* seqGroup = new QSequentialAnimationGroup();
QPropertyAnimation* anim = new QPropertyAnimation(widget(), "minimumHeight"); anim->setEndValue(height); anim->setDuration(animationDuration); seqGroup->addAnimation(anim); QPropertyAnimation* defixMaxSize = new QPropertyAnimation(widget(), "maximumSize"); defixMaxSize->setEndValue(QSize(16777215,16777215)); defixMaxSize->setDuration(1); seqGroup->addAnimation(defixMaxSize); QPropertyAnimation* defixMinSize = new QPropertyAnimation(widget(), "minimumSize"); defixMinSize->setEndValue(QSize(0,0)); defixMinSize->setDuration(1); seqGroup->addAnimation(defixMinSize); seqGroup->start(QAbstractAnimation::DeleteWhenStopped);@
When the duration of the second two animations are 1, the widget does not grow all the way to "height", if the duration is changed to 10, they seem much more likely to. Can anybody clue me into why this is happening?