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

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.

主站蜘蛛池模板: 察雅县| 周口市| 浦北县| 大邑县| 循化| 平遥县| 子洲县| 咸宁市| 寿光市| 安丘市| 南川市| 合肥市| 广昌县| 平乐县| 左权县| 临夏市| 黑龙江省| 上思县| 静海县| 团风县| 印江| 南安市| 四子王旗| 土默特右旗| 永济市| 秀山| 柳江县| 彰化市| 乌恰县| 泗洪县| 赣州市| 凤翔县| 清远市| 清水县| 嵩明县| 贵州省| 收藏| 云南省| 绵竹市| 武鸣县| 正安县|