## Qt-窗口动画

Qt学习记录-窗口动画

窗口动画主要用到QPropertyAnimation类。

	//获取控件位置
	QPoint point(ui.treeWidget->pos());
	int px = point.x();
	int py = point.y();
	//创建窗口进入特效
	QPropertyAnimation* animation = new QPropertyAnimation(ui.treeWidget, "pos");
	//设置窗口进入的起始位置
	animation->setDuration(500);
	animation->setStartValue(QPoint(0, py));
	animation->setEndValue(QPoint(px, py));
	//选择特效
	//animation->setEasingCurve(QEasingCurve::OutBounce);
	//开始播放特效
	animation->start();

猜你喜欢

转载自blog.csdn.net/qq_34248512/article/details/83176432