Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1
-
None
-
ec5f402cfd0bc439cd373ca8c99c59cb11556966
Description
The following snippet prints different values even though the two easingcurves are seemingly configured the same.
The issue is that setType_helper() (qeasingcurve.cpp:1337) checks for an existing config and doesn't really do what its supposed to do if there is one. Using setPeriod() before setType() generates such a config with the type set at that time, which is QEasingCurve::Linear by default.
#include <QEasingCurve>
#include <QDebug>
int main(int argc, char *argv[]) {
QEasingCurve c1;
c1.setType(QEasingCurve::OutSine);
c1.setPeriod(1);
QEasingCurve c2;
c2.setPeriod(1);
c2.setType(QEasingCurve::OutSine);
qDebug() << c1.valueForProgress(.8) << c2.valueForProgress(.8);
}