首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QPropertyAnimation修改间隔

QPropertyAnimation修改间隔
EN

Stack Overflow用户
提问于 2015-04-18 11:34:17
回答 1查看 452关注 0票数 0

我使用一个QPropertyAnimation对象以下列方式移动一些控件:

代码语言:javascript
复制
    QPropertyAnimation* animation = new QPropertyAnimation(message_, "pos");
    animation->setDuration(2000);
    animation->setStartValue(current_pos);
    animation->setEndValue(new_pos); 
    animation->setEasingCurve(QEasingCurve::Linear);
    animation->start(QAbstractAnimation::DeleteWhenStopped);

    asl::checkedConnect(animation, SIGNAL(finished()), this, SLOT(slotScrollingFinished()));

该对象通过每隔几毫秒执行一次并修改pos属性的值来工作AFAIK,直到持续时间过期并达到结束值为止。

我想知道是否有一种方法可以修改内部QPropertyAnimation对象的间隔计时器,以更改它将在2秒内访问pos属性的次数。

我在医生里什么也看不见。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-10 15:39:05

你可以这样做:

代码语言:javascript
复制
#include <qt/src/corelib/animation/qabstractanimation_p.h>

QUnifiedTimer::instance()->setTimingInterval(new_interval);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29716738

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档