25 Q_PROPERTY( Type type READ type )
31 Q_PROPERTY( QskGradientStops stops READ stops WRITE setStops )
33 Q_PROPERTY( SpreadMode spreadMode READ spreadMode WRITE setSpreadMode )
34 Q_PROPERTY( StretchMode stretchMode READ stretchMode WRITE setStretchMode )
36 Q_PROPERTY(
bool valid READ isValid )
37 Q_PROPERTY(
bool visible READ isVisible )
38 Q_PROPERTY(
bool monochrome READ isMonochrome )
40 Q_CLASSINFO(
"DefaultProperty",
"stops" )
85 bool operator==(
const QskGradient& )
const noexcept;
86 bool operator!=(
const QskGradient& )
const noexcept;
88 QskGradient::Type type()
const noexcept;
91 void setLinearDirection( qreal, qreal, qreal, qreal );
92 void setLinearDirection( Qt::Orientation );
96 void setRadialDirection(
const qreal x, qreal y, qreal radius );
97 void setRadialDirection(
const qreal x, qreal y, qreal radiusX, qreal radiusY );
100 void setConicDirection( qreal x, qreal y );
102 void setConicDirection( qreal x, qreal y,
103 qreal startAngle, qreal spanAngle = 360.0 );
105 void setConicDirection( qreal x, qreal y,
106 qreal startAngle, qreal spanAngle, qreal aspectRatio );
111 void setDirection( Type );
112 void resetDirection();
114 bool isValid()
const noexcept;
115 bool isMonochrome()
const noexcept;
116 bool isVisible()
const noexcept;
118 void setStops(
const QskGradientStops& );
119 const QskGradientStops& stops()
const noexcept;
121 void setStops(
const QRgb );
122 void setStops( Qt::GlobalColor );
123 void setStops(
const QColor& );
125 void setStops(
const QColor&,
const QColor& );
126 void setStops( QGradient::Preset );
130 Q_INVOKABLE
bool hasStopAt( qreal value )
const noexcept;
132 Q_INVOKABLE QColor startColor()
const noexcept;
133 Q_INVOKABLE QColor endColor()
const noexcept;
135 QRgb rgbStart()
const;
138 void setAlpha(
int alpha );
140 void setSpreadMode( SpreadMode );
141 SpreadMode spreadMode()
const noexcept;
143 void setStretchMode( StretchMode );
144 StretchMode stretchMode()
const noexcept;
151 void stretchTo(
const QRectF& );
159 QskGradient extracted( qreal from, qreal start )
const;
161 QskHashValue hash( QskHashValue seed = 0 )
const;
163 Q_INVOKABLE qreal stopAt(
int index )
const noexcept;
164 Q_INVOKABLE QColor colorAt(
int index )
const noexcept;
166 int stepCount()
const noexcept;
168 QGradient toQGradient()
const;
171 void updateStatusBits()
const;
174 QskGradientStops m_stops;
181 qreal m_values[5] = {};
183 unsigned int m_type : 3;
184 unsigned int m_spreadMode : 3;
185 unsigned int m_stretchMode : 3;
187 mutable bool m_isDirty : 1;
188 mutable bool m_isValid : 1;
189 mutable bool m_isMonchrome : 1;
190 mutable bool m_isVisible : 1;
262 return m_stops.isEmpty() ? qRgba( 0, 0, 0, 255 ) : m_stops.first().rgb();
267 return m_stops.isEmpty() ? qRgba( 0, 0, 0, 255 ) : m_stops.last().rgb();