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

RadialGradient QML Type

Radial gradient.

This type was introduced in Qt 5.10.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

RadialGradient QML Type

  • Import Statement: import QtQuick.Shapes 1.4

  • Since:: Qt 5.10

  • Inherits:: ShapeGradient

  • Group: RadialGradient is part of qtquick-paths, qtquick-views

Detailed Description

Radial gradients interpolate colors between a focal circle and a center circle in Shape items. Points outside the cone defined by the two circles will be transparent.

Outside the end points the gradient is either padded, reflected or repeated depending on the spread type.

Below is an example of a simple radial gradient. Here the colors are interpolated between the specified point and the end points on a circle specified by the radius:

 
Sélectionnez
fillGradient: RadialGradient {
    centerX: 50; centerY: 50
    centerRadius: 100
    focalX: centerX; focalY: centerY
    GradientStop { position: 0; color: "blue" }
    GradientStop { position: 0.2; color: "green" }
    GradientStop { position: 0.4; color: "red" }
    GradientStop { position: 0.6; color: "yellow" }
    GradientStop { position: 1; color: "cyan" }
}
Image non disponible

Extended radial gradients, where a separate focal circle is specified, are also supported.

RadialGradient is only supported in combination with Shape items. It is not compatible with Rectangle, as that only supports Gradient.

See Also

See also QRadialGradient

Property Documentation

 

centerX : real

centerY : real

focalX : real

focalY : real

These properties define the center and focal points. To specify a simple radial gradient, set focalX and focalY to the value of centerX and centerY, respectively.

centerRadius : real

focalRadius : real

These properties define the center and focal radius. For simple radial gradients, focalRadius should be set to 0 (the default value).

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