//定时器
QTimer类
QTimer * timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(xxxx()));
timer->setInterval(1000); //设置间隔时间 事件单位毫秒
timer->setSingleShot(true);
timer->start(); //启动定时器
timer->stop(); //关闭定期器
//QPropertyAnimation动画类
//用动画设置窗口透明度
QPropertyAnimation *animation = new QPropertyAnimation(this, “windowOpacity”);
animation->setDuration(3000); //动画历时 动画出现多长时间结束
animation->setStartValue(0); //设置起始值
animation->setEndValue(1); //设置结束值
animation->start();//开启动画
//用动画设置窗口的移动
QPropertyAnimation *animation = new QPropertyAnimation(this, "pos");
//animation->setDuration(3000);
animation->setStartValue(QPoint(-100, -100));
animation->setEndValue(QPoint(500, 100));
animation->setEasingCurve(QEasingCurve::Linear);
connect(animation, SIGNAL(finished()), this, SLOT(xxx())); //动画结束后需要执行的函数
animation->start();