先看看效果:

    

Qt窗口的消失简单动画Demo_Qt

核心代码:

QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity");
animation->setDuration(3000);
animation->setStartValue(1);
animation->setEndValue(0);
animation->start();
connect(animation, SIGNAL(finished()), this, SLOT(close()));