I have a task were I need to execute a sequence of PropertyAnimations. One of the animations is changing the visibility of a QWidget. When I try to hide it, it works perfectly fine:
QPropertyAnimation *pAnim = new QPropertyAnimation(pWidget, "visible");
pAnim->setStartValue(true);
pAnim->setEndValue(false);
pAnim->start(QAbstractAnimation::DeleteWhenStopped);
But when I try it the other way around, nothing happens:
QPropertyAnimation *pAnim = new QPropertyAnimation(pWidget, "visible");
pAnim->setStartValue(false);
pAnim->setEndValue(true);
pAnim->start(QAbstractAnimation::DeleteWhenStopped);
Am I doing something wrong? Or might this be a bug in Qt? I am using Qt 5.6.1 if that helps.