我有个问题。我使用QPropertyAnimation来移动QLabel,但不起作用。
void TitleChannel::changeChannel(float angle){
int channel=(int)(angle/60);
QPropertyAnimation *animation = new QPropertyAnimation(label, "geometry");
animation->setDuration(10000);
animation->setStartValue(QRect(0, 0, 360, 200));
animation->setEndValue(QRect(0, 240, 360, 200));
animation->setEasingCurve(QEasingCurve::InOutElastic);
animation->start();
}"label“是一个Qlabel指针,它是构造函数的一个参数。我也使用属性"pos“,但不使用works。"label“开始进入QRect(0,0,360,200),但没有移动到QRect(0,240,360,200),有什么帮助吗?谢谢
发布于 2010-04-20 16:25:46
它在台式机上运行良好。您是否尝试过在头文件中声明QPropertyAnimation *动画;并在构造函数上初始化它,然后在那里的函数上使用它?
因为不管动画应该在什么平台上运行,我也在诺基亚5800上使用QPropertyAnimation。
https://stackoverflow.com/questions/2593474
复制相似问题