效果的一行 / 多行文字从 beg_pos 飘到 dest_pos,
主要是这个飘。。。
------解决方案--------------------
那什么是飘。。。
------解决方案--------------------
------解决方案--------------------
是从一边飞到另一边么..
------解决方案--------------------
就是文本控件的坐标移动?用QPropertyAnimation。
- C/C++ code
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();
------解决方案--------------------
哈,QML飘过……
- C/C++ code
import QtQuick 1.1Rectangle { Text { id: text text: "Hello World" } PropertyAnimation { target: text property: "y" from: 640 to: 0 running: true duration: 3000 }}
------解决方案--------------------
------解决方案--------------------
没事自己看demo吧:/usr/local/Trolltech/Qt-4.8.0/examples/declarative/text