官术网_书友最值得收藏!

How it works...

To let an easing curve control the animation, all you need to do is define an easing curve and add it to the property animation before calling the start() function. You can also try several other types of easing curve and see which one suits you best. Here is an example:

animation->setEasingCurve(QEasingCurve::OutBounce);

If you want the animation to loop after it has finished playing, you can call the setLoopCount() function to set how many loops you want it to repeat for or set the value to -1 for an infinite loop:

animation->setLoopCount(-1);

There are several parameters that you can set to refine the easing curve before applying it to the property animation. These parameters include amplitude, overshoot, and period:

  • Amplitude: The higher the amplitude, the higher the bounce or elastic spring effect that will be applied to the animation.
  • Overshoot: Some curve functions will produce an overshoot (exceeding its final value) curve due to a damping effect. By adjusting the overshoot value, we are able to increase or decrease this effect.
  • Period: Setting a small period value will give a high frequency to the curve. A large period will give it a small frequency.

These parameters, however, are not applicable to all curve types. Please refer to the Qt documentation to see which parameter is applicable to which curve type.

主站蜘蛛池模板: 丰城市| 遂川县| 五家渠市| 扶沟县| 天等县| 赫章县| 布拖县| 安岳县| 开江县| 宜黄县| 南澳县| 监利县| 沂源县| 永仁县| 安义县| 汉中市| 沧源| 闻喜县| 明星| 永泰县| 政和县| 潍坊市| 襄樊市| 古蔺县| 玉田县| 资兴市| 镇雄县| 宁强县| 长葛市| 子洲县| 宁安市| 北京市| 宁河县| 汤原县| 紫金县| 鲜城| 庆阳市| 大同县| 繁峙县| 专栏| 颍上县|