Skip to content

PythonQt.Qt.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 (shared captured text)
CosineCurve attribute Any (shared captured text)
Custom attribute Any (shared captured text)
InBack attribute Any (shared captured text)
InBounce attribute Any (shared captured text)
InCirc attribute Any (shared captured text)
InCubic attribute Any (shared captured text)
InCurve attribute Any (shared captured text)
InElastic attribute Any (shared captured text)
InExpo attribute Any (shared captured text)
InOutBack attribute Any (shared captured text)
InOutBounce attribute Any (shared captured text)
InOutCirc attribute Any (shared captured text)
InOutCubic attribute Any (shared captured text)
InOutElastic attribute Any (shared captured text)
InOutExpo attribute Any (shared captured text)
InOutQuad attribute Any (shared captured text)
InOutQuart attribute Any (shared captured text)
InOutQuint attribute Any (shared captured text)
InOutSine attribute Any (shared captured text)
InQuad attribute Any (shared captured text)
InQuart attribute Any (shared captured text)
InQuint attribute Any (shared captured text)
InSine attribute Any (shared captured text)
Linear attribute Any (shared captured text)
NCurveTypes attribute Any (shared captured text)
OutBack attribute Any (shared captured text)
OutBounce attribute Any (shared captured text)
OutCirc attribute Any (shared captured text)
OutCubic attribute Any (shared captured text)
OutCurve attribute Any (shared captured text)
OutElastic attribute Any (shared captured text)
OutExpo attribute Any (shared captured text)
OutInBack attribute Any (shared captured text)
OutInBounce attribute Any (shared captured text)
OutInCirc attribute Any (shared captured text)
OutInCubic attribute Any (shared captured text)
OutInElastic attribute Any (shared captured text)
OutInExpo attribute Any (shared captured text)
OutInQuad attribute Any (shared captured text)
OutInQuart attribute Any (shared captured text)
OutInQuint attribute Any (shared captured text)
OutInSine attribute Any (shared captured text)
OutQuad attribute Any (shared captured text)
OutQuart attribute Any (shared captured text)
OutQuint attribute Any (shared captured text)
OutSine attribute Any (shared captured text)
SineCurve attribute Any (shared captured text)
TCBSpline attribute Any (shared captured text)
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) (shared captured text)
addTCBSegment function (self, nextPoint: Any, t: float, c: float, b: float) -> None X.addTCBSegment(nextPoint, t, c, b) (shared captured text)
amplitude function (self) -> float X.amplitude() -> float (shared captured text)
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 (shared captured text)
overshoot function (self) -> float X.overshoot() -> float (shared captured text)
period function (self) -> float X.period() -> float (shared captured text)
readFrom function (self, arg__1: Any) -> Any (shared captured text)
setAmplitude function (self, amplitude: float) -> None Sets the amplitude to amplitude. (shared captured text)
setOvershoot function (self, overshoot: float) -> None Sets the overshoot to overshoot. (shared captured text)
setPeriod function (self, period: float) -> None Sets the period to period. (shared captured text)
setType function (self, type: Any) -> None Sets the type of the easing curve to type. (shared captured text)
swap function (self, other: Any) -> None Swaps curve other with this curve. (shared captured text)
toCubicSpline function (self) -> tuple X.toCubicSpline() -> tuple (shared captured text)
type function (self) -> Any Returns the type of the easing curve. (shared captured text)
valueForProgress function (self, progress: float) -> float X.valueForProgress(progress) -> float (shared captured text)
writeTo function (self, arg__1: Any) -> Any (shared captured text)