QtBase  v6.3.1
Public Member Functions | List of all members
QRadialGradient Class Reference

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

#include <qbrush.h>

Inheritance diagram for QRadialGradient:
Inheritance graph
[legend]
Collaboration diagram for QRadialGradient:
Collaboration graph
[legend]

Public Member Functions

 QRadialGradient ()
 
 QRadialGradient (const QPointF &center, qreal radius, const QPointF &focalPoint)
 
 QRadialGradient (qreal cx, qreal cy, qreal radius, qreal fx, qreal fy)
 
 QRadialGradient (const QPointF &center, qreal radius)
 
 QRadialGradient (qreal cx, qreal cy, qreal 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
 
void setCenter (const QPointF &center)
 
void setCenter (qreal x, qreal y)
 
QPointF focalPoint () const
 
void setFocalPoint (const QPointF &focalPoint)
 
void setFocalPoint (qreal x, qreal y)
 
qreal radius () const
 
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
 
void setSpread (Spread spread)
 
Spread spread () const
 
void setColorAt (qreal pos, const QColor &color)
 
void setStops (const QGradientStops &stops)
 
QGradientStops stops () const
 
CoordinateMode coordinateMode () const
 
void setCoordinateMode (CoordinateMode mode)
 
InterpolationMode interpolationMode () const
 
void setInterpolationMode (InterpolationMode mode)
 
bool operator== (const QGradient &gradient) const
 
bool operator!= (const QGradient &other) const
 

Additional Inherited Members

- Public Types inherited from QGradient
enum  Type { LinearGradient , RadialGradient , ConicalGradient , NoGradient }
 
enum  Spread { PadSpread , ReflectSpread , RepeatSpread }
 
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

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

\inmodule QtGui

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 447 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 2124 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 2058 of file qbrush.cpp.

Here is the call graph for this function:

◆ 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 2103 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 2078 of file qbrush.cpp.

Here is the call graph for this function:

◆ 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 2114 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 2142 of file qbrush.cpp.

Here is the call graph for this function:

◆ 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 2163 of file qbrush.cpp.

Here is the call graph for this function:

◆ ~QRadialGradient()

QRadialGradient::~QRadialGradient ( )

Definition at line 2180 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 2190 of file qbrush.cpp.

Here is the caller graph for this function:

◆ 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 2261 of file qbrush.cpp.

Here is the caller graph for this function:

◆ focalPoint()

QPointF QRadialGradient::focalPoint ( ) const

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

See also
QGradient::stops()

Definition at line 2312 of file qbrush.cpp.

Here is the caller graph for this function:

◆ 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 2287 of file qbrush.cpp.

Here is the caller graph for this function:

◆ 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 2232 of file qbrush.cpp.

Here is the caller graph for this function:

◆ 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 2216 of file qbrush.cpp.

Here is the call graph for this function:

◆ 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 464 of file qbrush.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 2273 of file qbrush.cpp.

Here is the call graph for this function:

◆ 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 2338 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 468 of file qbrush.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 2299 of file qbrush.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 2247 of file qbrush.cpp.

Here is the call graph for this function:

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