PythonQt.QtCore.QEasingCurve
QEasingCurve
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
Easing curves describe a function that controls how the speed of the interpolation between 0 and 1 should be. Easing curves allow transitions from one value to another to appear more natural than a simple constant speed would allow. The QEasingCurve class is usually used in conjunction with the QVariantAnimation and QPropertyAnimation classes but can be used on its own. It is usually used to accelerate the interpolation from zero velocity (ease in) or decelerate to zero velocity (ease out). Ease in and ease out can also be combined in the same easing curve.
To calculate the speed of the interpolation, the easing curve provides the function valueForProgress(), where the progress argument specifies the progress of the interpolation: 0 is the start value of the interpolation, 1 is the end value of the interpolation. The returned value is the effective progress of the interpolation. If the returned value is the same as the input value for all input values the easing curve is a linear curve. This is the default behaviour.
For example,
QEasingCurve easing(QEasingCurve::InOutQuad);
for (qreal t = 0.0; t < 1.0; t += 0.1)
qWarning() << "Effective progress" << t << "is"
<< easing.valueForProgress(t);
will print the effective progress of the interpolation between 0 and 1.
When using a QPropertyAnimation, the associated easing curve will be used to control the progress of the interpolation between startValue and endValue:
QPropertyAnimation animation;
animation.setStartValue(0);
animation.setEndValue(1000);
animation.setDuration(1000);
animation.setEasingCurve(QEasingCurve::InOutQuad);
The ability to set an amplitude, overshoot, or period depends on the QEasingCurve type. Amplitude access is available to curves that behave as springs such as elastic and bounce curves. Changing the amplitude changes the height of the curve. Period access is only available to elastic curves and setting a higher period slows the rate of bounce. Only curves that have "boomerang" behaviors such as the InBack, OutBack, InOutBack, and OutInBack have overshoot settings. These curves will interpolate beyond the end points and return to the end point, acting similar to a boomerang.
The Easing Curves Example contains samples of QEasingCurve types and lets you change the curve settings.
Source: https://doc.qt.io/archives/qt-5.15/qeasingcurve.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
BezierSpline |
attribute | Any |
|
CosineCurve |
attribute | Any |
|
Custom |
attribute | Any |
|
InBack |
attribute | Any |
|
InBounce |
attribute | Any |
|
InCirc |
attribute | Any |
|
InCubic |
attribute | Any |
|
InCurve |
attribute | Any |
|
InElastic |
attribute | Any |
|
InExpo |
attribute | Any |
|
InOutBack |
attribute | Any |
|
InOutBounce |
attribute | Any |
|
InOutCirc |
attribute | Any |
|
InOutCubic |
attribute | Any |
|
InOutElastic |
attribute | Any |
|
InOutExpo |
attribute | Any |
|
InOutQuad |
attribute | Any |
|
InOutQuart |
attribute | Any |
|
InOutQuint |
attribute | Any |
|
InOutSine |
attribute | Any |
|
InQuad |
attribute | Any |
|
InQuart |
attribute | Any |
|
InQuint |
attribute | Any |
|
InSine |
attribute | Any |
|
Linear |
attribute | Any |
|
NCurveTypes |
attribute | Any |
|
OutBack |
attribute | Any |
|
OutBounce |
attribute | Any |
|
OutCirc |
attribute | Any |
|
OutCubic |
attribute | Any |
|
OutCurve |
attribute | Any |
|
OutElastic |
attribute | Any |
|
OutExpo |
attribute | Any |
|
OutInBack |
attribute | Any |
|
OutInBounce |
attribute | Any |
|
OutInCirc |
attribute | Any |
|
OutInCubic |
attribute | Any |
|
OutInElastic |
attribute | Any |
|
OutInExpo |
attribute | Any |
|
OutInQuad |
attribute | Any |
|
OutInQuart |
attribute | Any |
|
OutInQuint |
attribute | Any |
|
OutInSine |
attribute | Any |
|
OutQuad |
attribute | Any |
|
OutQuart |
attribute | Any |
|
OutQuint |
attribute | Any |
|
OutSine |
attribute | Any |
|
SineCurve |
attribute | Any |
|
TCBSpline |
attribute | Any |
|
Type |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
addCubicBezierSegment |
function | (self, c1: Any, c2: Any, endPoint: Any) -> None |
X.addCubicBezierSegment(c1, c2, endPoint) |
addTCBSegment |
function | (self, nextPoint: Any, t: float, c: float, b: float) -> None |
X.addTCBSegment(nextPoint, t, c, b) |
amplitude |
function | (self) -> float |
X.amplitude() -> float |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
operator_assign |
function | (self, other: Any) -> Any |
X.operator_assign(other) -> PythonQt.QtCore.QEasingCurve |
overshoot |
function | (self) -> float |
X.overshoot() -> float |
period |
function | (self) -> float |
X.period() -> float |
readFrom |
function | (self, arg__1: Any) -> Any |
(shared captured text) |
setAmplitude |
function | (self, amplitude: float) -> None |
Sets the amplitude to amplitude. |
setOvershoot |
function | (self, overshoot: float) -> None |
Sets the overshoot to overshoot. |
setPeriod |
function | (self, period: float) -> None |
Sets the period to period. |
setType |
function | (self, type: Any) -> None |
Sets the type of the easing curve to type. |
swap |
function | (self, other: Any) -> None |
Swaps curve other with this curve. |
toCubicSpline |
function | (self) -> tuple |
X.toCubicSpline() -> tuple |
type |
function | (self) -> Any |
Returns the type of the easing curve. |
valueForProgress |
function | (self, progress: float) -> float |
X.valueForProgress(progress) -> float |
writeTo |
function | (self, arg__1: Any) -> Any |
(shared captured text) |