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

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.

主站蜘蛛池模板: 上犹县| 昌图县| 清涧县| 广水市| 吐鲁番市| 平远县| 广东省| 错那县| 英超| 海淀区| 常熟市| 儋州市| 兴文县| 岳池县| 绥江县| 贺州市| 平安县| 浪卡子县| 读书| 游戏| 砚山县| 新竹市| 穆棱市| 榆树市| 安国市| 玛多县| 石门县| 临漳县| 始兴县| 交城县| 遵义县| 聊城市| 自治县| 沁水县| 游戏| 大宁县| 比如县| 庄河市| 桂阳县| 昭通市| 深州市|