PDA

View Full Version : Qt5/C++ - QEasingCurve, change bounce height



jimbo
20th June 2016, 19:01
Qt 5.60

Hello,

Trying to change the bounce height of an easing curve.
Even with a value of zero, the bounce always looks the same.
What am I doing wrong?

Regards


From the help system:-
void QEasingCurve::setOvershoot(qreal overshoot)
Sets the overshoot to overshoot.
0 produces no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent.


qreal overshoot = 1.7; // 0.0
QEasingCurve easing = (QEasingCurve::OutElastic);
QPropertyAnimation *animation[qty];
for (uint i = 0; i < qty; i++)
{
animation[i] = new QPropertyAnimation(numLabel[i], "geometry");
animation[i]->setDuration(1500);

easing.setOvershoot(overshoot);
//easing.setAmplitude(overshoot);

animation[i]->setEasingCurve(easing);

animation[i]->setStartValue(QRect(-2, -86, 100, 80));
animation[i]->setEndValue(QRect(-2, -2, 100, 80));
}

for (uint i = 0; i < qty; i++)
{
animation[i]->start();
tDelay(300); // milliSecs
}

jimbo
21st June 2016, 15:05
Hello,

It appears you need to change both Amplitude and Period to get any change,
and play with the values to get the effect you want.

//easing.setOvershoot(overshoot);
easing.setAmplitude(amplitude);
easing.setPeriod(period);
Regards