IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

BoundaryRule QML Type

Defines a restriction on the range of values that can be set on a numeric property.

This type was introduced in Qt 5.14.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

BoundaryRule QML Type▲

  • Import Statement: import Qt.labs.animation 1.0

  • Since: Qt 5.14

  • Group: BoundaryRule is part of qtquick-transitions-animations, qtquick-interceptors

Detailed Description▲

A https:// defines the range of values that a particular property is allowed to have. When an out-of-range value would otherwise be set, it applies "resistance" via an easing curve.

For example, the following https:// prevents https:// from dragging the Rectangle too far:

 
Sélectionnez
import QtQuick 2.14
import Qt.labs.animation 1.0

Rectangle {
    id: root
    width: 170; height: 120
    color: "green"

    DragHandler {
        id: dragHandler
        yAxis.minimum: -1000
        xAxis.minimum: -1000
        onActiveChanged: if (!active) xbr.returnToBounds();
    }

    BoundaryRule on x {
        id: xbr
        minimum: -50
        maximum: 100
        minimumOvershoot: 40
        maximumOvershoot: 40
    }
}

Note that a property cannot have more than one assigned https://.

See Also▲

See also https://, https://, https://

Property Documentation▲

 

currentOvershoot : qreal▲

This property holds the amount by which the most recently set value of the intercepted property exceeds https:// or is less than https://.

It is positive if the property value exceeds https://, negative if the property value is less than https://, or 0 if the property value is within both boundaries.

easing : qreal▲

This property holds the easing curve to be applied in overshoot mode (whenever the https:// or https:// constraint is violated, while the value is still within the respective overshoot range).

The default easing curve is QEasingCurve::OutQuad.

enabled : bool▲

This property holds whether the rule will be enforced when the tracked property changes value.

By default a https:// is enabled.

maximum : qreal▲

This property holds the largest unconstrained value that the property is allowed to have. If the property is set to a larger value, it will be constrained by https:// and https://.

The default is 1.

maximumOvershoot : qreal▲

This property holds the amount that the property is allowed to be more than https://. Whenever the value is greater than https:// and less than maximum + maximumOvershoot, it is constrained by the https:// curve. When the value attempts to exceed maximum + maximumOvershoot there is a hard stop.

The default is 0.

minimum : qreal▲

This property holds the smallest unconstrained value that the property is allowed to have. If the property is set to a smaller value, it will be constrained by https:// and https://.

The default is 0.

minimumOvershoot : qreal▲

This property holds the amount that the property is allowed to be less than https://. Whenever the value is less than https:// and greater than minimum - minimumOvershoot, it is constrained by the https:// curve. When the value attempts to go under minimum - minimumOvershoots there is a hard stop.

The default is 0.

overshootFilter : enum▲

This property specifies the aggregation function that will be applied to the intercepted property value.

If this is set to BoundaryRule.None (the default), the intercepted property will hold a value whose overshoot is limited to https://. If this is set to BoundaryRule.Peak, the intercepted property will hold a value whose overshoot is limited to https://.

overshootScale : qreal▲

This property holds the amount by which the https:// is scaled during the overshoot condition. For example if an Item is restricted from moving more than 100 pixels beyond some limit, and the user (by means of some Input Handler) is trying to drag it 100 pixels past the limit, if overshootScale is set to 1, the user will succeed: the only effect of the easing curve is to change the rate at which the item moves from overshoot 0 to overshoot 100. But if it is set to 0.5, the https:// provides resistance such that when the user tries to move 100 pixels, the Item will only move 50 pixels; and the easing curve modulates the rate of movement such that it may move in sync with the user's attempted movement at the beginning, and then slows down, depending on the shape of the easing curve.

The default is 0.5.

peakOvershoot : qreal▲

This property holds the most-positive or most-negative value of https:// that has been seen, until https://() is called.

This can be useful when the intercepted property value is known to fluctuate, and you want to find and react to the maximum amount of overshoot rather than to the fluctuations.

See Also▲

See also https://

returnDuration : int▲

This property holds the amount of time in milliseconds that https://() will take to return the target property to the nearest bound. If it is set to 0, https://() will set the property immediately rather than creating an animation job.

The default is 100 ms.

Method Documentation▲

 

bool returnToBounds()▲

Returns the intercepted property to a value between https:// and https://, such that https:// and https:// are both zero. This will be animated if https:// is greater than zero.

Returns true if the value needed to be adjusted, or false if it was already within bounds.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.