当前位置: 代码迷 >> QT开发 >> 求Qt的文字飘动代码,该如何处理
  详细解决方案

求Qt的文字飘动代码,该如何处理

热度:62   发布时间:2016-04-25 04:54:40.0
求Qt的文字飘动代码
效果的一行 / 多行文字从 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
  相关解决方案