Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QRadialGradient Class Reference

\inmodule QtGui More...

#include <qbrush.h>

Inheritance diagram for QRadialGradient:
Collaboration diagram for QRadialGradient:

Public Member Functions

 QRadialGradient ()
 Constructs a simple radial gradient with the center and focal point at (0, 0) with a radius of 1.
 QRadialGradient (const QPointF &center, qreal radius, const QPointF &focalPoint)
 Constructs a simple radial gradient with the given center, radius and focalPoint.
 QRadialGradient (qreal cx, qreal cy, qreal radius, qreal fx, qreal fy)
 Constructs a simple radial gradient with the given center (cx, cy), radius and focal point (fx, fy).
 QRadialGradient (const QPointF &center, qreal radius)
 Constructs a simple radial gradient with the given center, radius and the focal point in the circle center.
 QRadialGradient (qreal cx, qreal cy, qreal radius)
 Constructs a simple radial gradient with the center at (cx, cy) and the specified radius.
 QRadialGradient (const QPointF &center, qreal centerRadius, const QPointF &focalPoint, qreal focalRadius)
 QRadialGradient (qreal cx, qreal cy, qreal centerRadius, qreal fx, qreal fy, qreal focalRadius)
 ~QRadialGradient ()
QPointF center () const
 Returns the center of this radial gradient in logical coordinates.
void setCenter (const QPointF &center)
void setCenter (qreal x, qreal y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QPointF focalPoint () const
 Returns the focal point of this radial gradient in logical coordinates.
void setFocalPoint (const QPointF &focalPoint)
void setFocalPoint (qreal x, qreal y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
qreal radius () const
 Returns the radius of this radial gradient in logical coordinates.
void setRadius (qreal radius)
qreal centerRadius () const
void setCenterRadius (qreal radius)
qreal focalRadius () const
void setFocalRadius (qreal radius)
Public Member Functions inherited from QGradient
 QGradient ()
 QGradient (Preset)
 ~QGradient ()
Type type () const
 Returns the type of gradient.
void setSpread (Spread spread)
 Specifies the spread method that should be used for this gradient.
Spread spread () const
 Returns the spread method use by this gradient.
void setColorAt (qreal pos, const QColor &color)
 Creates a stop point at the given position with the given color.
void setStops (const QGradientStops &stops)
 Replaces the current set of stop points with the given stopPoints.
QGradientStops stops () const
 Returns the stop points for this gradient.
CoordinateMode coordinateMode () const
void setCoordinateMode (CoordinateMode mode)
InterpolationMode interpolationMode () const
void setInterpolationMode (InterpolationMode mode)
bool operator== (const QGradient &gradient) const
 Returns true if the gradient is the same as the other gradient specified; otherwise returns false.
bool operator!= (const QGradient &other) const

Additional Inherited Members

Public Types inherited from QGradient
enum  Type { LinearGradient , RadialGradient , ConicalGradient , NoGradient }
 Specifies the type of gradient. More...
enum  Spread { PadSpread , ReflectSpread , RepeatSpread }
 Specifies how the area outside the gradient area should be filled. More...
enum  CoordinateMode { LogicalMode , StretchToDeviceMode , ObjectBoundingMode , ObjectMode }
enum  InterpolationMode { ColorInterpolation , ComponentInterpolation }
enum  Preset {
  WarmFlame = 1 , NightFade = 2 , SpringWarmth = 3 , JuicyPeach = 4 ,
  YoungPassion = 5 , LadyLips = 6 , SunnyMorning = 7 , RainyAshville = 8 ,
  FrozenDreams = 9 , WinterNeva = 10 , DustyGrass = 11 , TemptingAzure = 12 ,
  HeavyRain = 13 , AmyCrisp = 14 , MeanFruit = 15 , DeepBlue = 16 ,
  RipeMalinka = 17 , CloudyKnoxville = 18 , MalibuBeach = 19 , NewLife = 20 ,
  TrueSunset = 21 , MorpheusDen = 22 , RareWind = 23 , NearMoon = 24 ,
  WildApple = 25 , SaintPetersburg = 26 , PlumPlate = 28 , EverlastingSky = 29 ,
  HappyFisher = 30 , Blessing = 31 , SharpeyeEagle = 32 , LadogaBottom = 33 ,
  LemonGate = 34 , ItmeoBranding = 35 , ZeusMiracle = 36 , OldHat = 37 ,
  StarWine = 38 , HappyAcid = 41 , AwesomePine = 42 , NewYork = 43 ,
  ShyRainbow = 44 , MixedHopes = 46 , FlyHigh = 47 , StrongBliss = 48 ,
  FreshMilk = 49 , SnowAgain = 50 , FebruaryInk = 51 , KindSteel = 52 ,
  SoftGrass = 53 , GrownEarly = 54 , SharpBlues = 55 , ShadyWater = 56 ,
  DirtyBeauty = 57 , GreatWhale = 58 , TeenNotebook = 59 , PoliteRumors = 60 ,
  SweetPeriod = 61 , WideMatrix = 62 , SoftCherish = 63 , RedSalvation = 64 ,
  BurningSpring = 65 , NightParty = 66 , SkyGlider = 67 , HeavenPeach = 68 ,
  PurpleDivision = 69 , AquaSplash = 70 , SpikyNaga = 72 , LoveKiss = 73 ,
  CleanMirror = 75 , PremiumDark = 76 , ColdEvening = 77 , CochitiLake = 78 ,
  SummerGames = 79 , PassionateBed = 80 , MountainRock = 81 , DesertHump = 82 ,
  JungleDay = 83 , PhoenixStart = 84 , OctoberSilence = 85 , FarawayRiver = 86 ,
  AlchemistLab = 87 , OverSun = 88 , PremiumWhite = 89 , MarsParty = 90 ,
  EternalConstance = 91 , JapanBlush = 92 , SmilingRain = 93 , CloudyApple = 94 ,
  BigMango = 95 , HealthyWater = 96 , AmourAmour = 97 , RiskyConcrete = 98 ,
  StrongStick = 99 , ViciousStance = 100 , PaloAlto = 101 , HappyMemories = 102 ,
  MidnightBloom = 103 , Crystalline = 104 , PartyBliss = 106 , ConfidentCloud = 107 ,
  LeCocktail = 108 , RiverCity = 109 , FrozenBerry = 110 , ChildCare = 112 ,
  FlyingLemon = 113 , NewRetrowave = 114 , HiddenJaguar = 115 , AboveTheSky = 116 ,
  Nega = 117 , DenseWater = 118 , Seashore = 120 , MarbleWall = 121 ,
  CheerfulCaramel = 122 , NightSky = 123 , MagicLake = 124 , YoungGrass = 125 ,
  ColorfulPeach = 126 , GentleCare = 127 , PlumBath = 128 , HappyUnicorn = 129 ,
  AfricanField = 131 , SolidStone = 132 , OrangeJuice = 133 , GlassWater = 134 ,
  NorthMiracle = 136 , FruitBlend = 137 , MillenniumPine = 138 , HighFlight = 139 ,
  MoleHall = 140 , SpaceShift = 142 , ForestInei = 143 , RoyalGarden = 144 ,
  RichMetal = 145 , JuicyCake = 146 , SmartIndigo = 147 , SandStrike = 148 ,
  NorseBeauty = 149 , AquaGuidance = 150 , SunVeggie = 151 , SeaLord = 152 ,
  BlackSea = 153 , GrassShampoo = 154 , LandingAircraft = 155 , WitchDance = 156 ,
  SleeplessNight = 157 , AngelCare = 158 , CrystalRiver = 159 , SoftLipstick = 160 ,
  SaltMountain = 161 , PerfectWhite = 162 , FreshOasis = 163 , StrictNovember = 164 ,
  MorningSalad = 165 , DeepRelief = 166 , SeaStrike = 167 , NightCall = 168 ,
  SupremeSky = 169 , LightBlue = 170 , MindCrawl = 171 , LilyMeadow = 172 ,
  SugarLollipop = 173 , SweetDessert = 174 , MagicRay = 175 , TeenParty = 176 ,
  FrozenHeat = 177 , GagarinView = 178 , FabledSunset = 179 , PerfectBlue = 180 ,
  NumPresets
}

Detailed Description

\inmodule QtGui

The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush.

Qt supports both simple and extended radial gradients.

Simple radial gradients interpolate colors between a focal point and end points on a circle surrounding it. Extended radial gradients interpolate colors between a focal circle and a center circle. Points outside the cone defined by the two circles will be transparent. For simple radial gradients the focal point is adjusted to lie inside the center circle, whereas the focal point can have any position in an extended radial gradient.

Outside the end points the gradient is either padded, reflected or repeated depending on the currently set \l {QGradient::Spread}{spread} method:

\table \row

The colors in a gradient is defined using stop points of the QGradientStop type, i.e. a position and a color. Use the QGradient::setColorAt() or the QGradient::setStops() function to define the stop points. It is the gradient's complete set of stop points that describes how the gradient area should be filled. If no stop points have been specified, a gradient of black at 0 to white at 1 is used.

In addition to the functions inherited from QGradient, the QRadialGradient class provides the center(), focalPoint() and radius() functions returning the gradient's center, focal point and radius respectively.

See also
QLinearGradient, QConicalGradient, {painting/gradients}{The Gradients Example}

Definition at line 433 of file qbrush.h.

Constructor & Destructor Documentation

◆ QRadialGradient() [1/7]

QRadialGradient::QRadialGradient ( )

Constructs a simple radial gradient with the center and focal point at (0, 0) with a radius of 1.

Definition at line 2192 of file qbrush.cpp.

◆ QRadialGradient() [2/7]

QRadialGradient::QRadialGradient ( const QPointF & center,
qreal radius,
const QPointF & focalPoint )

Constructs a simple radial gradient with the given center, radius and focalPoint.

Note
If the given focal point is outside the circle defined by the center point and radius, it will be re-adjusted to lie at a point on the circle where it intersects with the line from center to focalPoint.
See also
QGradient::setColorAt(), QGradient::setStops()

Definition at line 2126 of file qbrush.cpp.

◆ QRadialGradient() [3/7]

QRadialGradient::QRadialGradient ( qreal cx,
qreal cy,
qreal radius,
qreal fx,
qreal fy )

Constructs a simple radial gradient with the given center (cx, cy), radius and focal point (fx, fy).

Note
If the given focal point is outside the circle defined by the center (cx, cy) and the radius it will be re-adjusted to the intersection between the line from the center to the focal point and the circle.
See also
QGradient::setColorAt(), QGradient::setStops()

Definition at line 2171 of file qbrush.cpp.

◆ QRadialGradient() [4/7]

QRadialGradient::QRadialGradient ( const QPointF & center,
qreal radius )

Constructs a simple radial gradient with the given center, radius and the focal point in the circle center.

See also
QGradient::setColorAt(), QGradient::setStops()

Definition at line 2146 of file qbrush.cpp.

◆ QRadialGradient() [5/7]

QRadialGradient::QRadialGradient ( qreal cx,
qreal cy,
qreal radius )

Constructs a simple radial gradient with the center at (cx, cy) and the specified radius.

The focal point lies at the center of the circle.

See also
QGradient::setColorAt(), QGradient::setStops()

Definition at line 2182 of file qbrush.cpp.

◆ QRadialGradient() [6/7]

QRadialGradient::QRadialGradient ( const QPointF & center,
qreal centerRadius,
const QPointF & focalPoint,
qreal focalRadius )
Since
4.8

Constructs an extended radial gradient with the given center, centerRadius, focalPoint, and focalRadius.

Definition at line 2210 of file qbrush.cpp.

◆ QRadialGradient() [7/7]

QRadialGradient::QRadialGradient ( qreal cx,
qreal cy,
qreal centerRadius,
qreal fx,
qreal fy,
qreal focalRadius )
Since
4.8

Constructs an extended radial gradient with the given center (cx, cy), center radius, centerRadius, focal point, (fx, fy), and focal radius focalRadius.

Definition at line 2230 of file qbrush.cpp.

◆ ~QRadialGradient()

QRadialGradient::~QRadialGradient ( )

Definition at line 2246 of file qbrush.cpp.

Member Function Documentation

◆ center()

QPointF QRadialGradient::center ( ) const

Returns the center of this radial gradient in logical coordinates.

See also
QGradient::stops()

Definition at line 2256 of file qbrush.cpp.

◆ centerRadius()

qreal QRadialGradient::centerRadius ( ) const
Since
4.8

Returns the center radius of this radial gradient in logical coordinates.

See also
QGradient::stops()

Definition at line 2327 of file qbrush.cpp.

◆ focalPoint()

QPointF QRadialGradient::focalPoint ( ) const

Returns the focal point of this radial gradient in logical coordinates.

See also
QGradient::stops()

Definition at line 2378 of file qbrush.cpp.

◆ focalRadius()

qreal QRadialGradient::focalRadius ( ) const
Since
4.8

Returns the focal radius of this radial gradient in logical coordinates.

See also
QGradient::stops()

Definition at line 2353 of file qbrush.cpp.

◆ radius()

qreal QRadialGradient::radius ( ) const

Returns the radius of this radial gradient in logical coordinates.

Equivalent to centerRadius()

See also
QGradient::stops()

Definition at line 2298 of file qbrush.cpp.

◆ setCenter() [1/2]

void QRadialGradient::setCenter ( const QPointF & center)
Since
4.2

Sets the center of this radial gradient in logical coordinates to center.

See also
center()

Definition at line 2282 of file qbrush.cpp.

◆ setCenter() [2/2]

void QRadialGradient::setCenter ( qreal x,
qreal y )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
4.2

Sets the center of this radial gradient in logical coordinates to (x, y).

See also
center()

Definition at line 450 of file qbrush.h.

◆ setCenterRadius()

void QRadialGradient::setCenterRadius ( qreal radius)
Since
4.8

Sets the center radius of this radial gradient in logical coordinates to radius

Definition at line 2339 of file qbrush.cpp.

◆ setFocalPoint() [1/2]

void QRadialGradient::setFocalPoint ( const QPointF & focalPoint)
Since
4.2

Sets the focal point of this radial gradient in logical coordinates to focalPoint.

See also
focalPoint()

Definition at line 2404 of file qbrush.cpp.

◆ setFocalPoint() [2/2]

void QRadialGradient::setFocalPoint ( qreal x,
qreal y )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
4.2

Sets the focal point of this radial gradient in logical coordinates to (x, y).

See also
focalPoint()

Definition at line 454 of file qbrush.h.

◆ setFocalRadius()

void QRadialGradient::setFocalRadius ( qreal radius)
Since
4.8

Sets the focal radius of this radial gradient in logical coordinates to radius

Definition at line 2365 of file qbrush.cpp.

◆ setRadius()

void QRadialGradient::setRadius ( qreal radius)
Since
4.2

Sets the radius of this radial gradient in logical coordinates to radius

Equivalent to setCenterRadius()

Definition at line 2313 of file qbrush.cpp.


The documentation for this class was generated from the following files: