StupidBeauty
Read times:304Posted at:Wed Jan 27 05:18:14 2010 - no title specified

QEasingCurve的详细描述

 QT4.6.0

 QEasingCurve类提供缓和曲线,用于控制动画。

缓和曲线描述的是一个用来控制从0到1之间的插值的速度的函数。相对于一个常数的速度来说,缓和曲线使得从一个值到另一个值的变化显得更自然。 QEasingCurve类通常与QVariantAnimation和QPropertyAnimation类一起使用,但也能单独使用。它通常用来加 速从0速度开始的插值(开始慢且加速)或者减速至0(开始快且减速)。开始慢且加速和开始快且减速能够合并到同一个缓和曲线中。

 缓和曲线提供函数valueForProgress()来计算插值的速度,其中的参数progress指定插值的值:0是开始值,1是结束值。返回值是插 值的有效进度。如果对于所有的传入参数值,返回值与传入的参数相等,则这个缓和曲线是线性的缓和曲线。这是默认的行为。

举例,

QEasingCurve easing(QEasingCurve::InOutQuad);

for(qreal t = 0.0; t < 1.0; t+=0.1)

qWarning() << "Effective progress" << t << " is "

                  << easing.valueForProgress(t);

会输出0到1之间的有效进度。

当使用QPropertyAnimation时,对应的缓和曲线将会被用来控制从开始值(startValue)到结束值(endValue)之间的插值:

QPropertyAnimation animation;

animation.setStartValue(0);

animation.setEndValue(1000);

animation.setDuration(1000);

animation.setEasingCurve(QEasingCurve::InOutQuad);

Your opinions

Posted at:Thu Jan 28 03:12:27 2010ys_sunshine呵呵,踩踩~~
Posted at:Tue Feb 23 10:01:56 2010china1000踩踩
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4