一.技术栈:QPropertyAnimation
要实现动态效果要用到QT的动画类:QPropertyAnimation 这个类有很多的动画效果;可能还有其他实现方式 这里使用这种实现方式 (注意*Since :Qt 4.6)
二. Detailed Description
核心代码、思想贴出来了;更多得方法和接口请自行看Qt的帮助文档
QPropertyAnimation *animation = new QPropertyAnimation(myWidget, "geometry");
animation->setDuration(10000);
animation->setStartValue(QRect(0, 0, 100, 30));
animation->setEndValue(QRect(250, 250, 100, 30));
animation->start();
三.实现效果
这里写了一个demo 展现给大家;实现左侧Widget动态伸缩
QT窗口动态效果展示
四.源码分享
QQ :2896816296