|
Krita Source Code Documentation
|
A gradient shape background. More...
#include <KoGradientBackground.h>
Inheritance diagram for KoGradientBackground:Classes | |
| class | Private |
Public Member Functions | |
| bool | compareTo (const KoShapeBackground *other) const override |
| const QGradient * | gradient () const |
| Returns the gradient. | |
| KoGradientBackground (const KoGradientBackground &) | |
| KoGradientBackground (const QGradient &gradient, const QTransform &matrix=QTransform()) | |
| KoGradientBackground (QGradient *gradient, const QTransform &matrix=QTransform()) | |
| KoGradientBackground & | operator= (const KoGradientBackground &) |
| void | paint (QPainter &painter, const QPainterPath &fillPath) const override |
| reimplemented from KoShapeBackground | |
| void | setGradient (const QGradient &gradient) |
| void | setTransform (const QTransform &matrix) |
| Sets the transform matrix. | |
| QTransform | transform () const |
| Returns the transform matrix. | |
| ~KoGradientBackground () override | |
| Destroys the background. | |
Public Member Functions inherited from KoShapeBackground | |
| virtual bool | hasTransparency () const |
| Returns if the background has some transparency. | |
| KoShapeBackground () | |
| virtual | operator bool () const |
| virtual | ~KoShapeBackground () |
Private Attributes | |
| QSharedDataPointer< Private > | d |
A gradient shape background.
Definition at line 19 of file KoGradientBackground.h.
|
explicit |
Creates new gradient background from given gradient. The background takes ownership of the given gradient.
Definition at line 31 of file KoGradientBackground.cpp.
References d, and gradient().
|
explicit |
Create new gradient background from the given gradient. A clone of the given gradient is used.
Definition at line 40 of file KoGradientBackground.cpp.
References KoFlake::cloneGradient(), d, and gradient().
|
override |
| KoGradientBackground::KoGradientBackground | ( | const KoGradientBackground & | rhs | ) |
Definition at line 54 of file KoGradientBackground.cpp.
|
overridevirtual |
Implements KoShapeBackground.
Definition at line 65 of file KoGradientBackground.cpp.
References d.
| const QGradient * KoGradientBackground::gradient | ( | ) | const |
| KoGradientBackground & KoGradientBackground::operator= | ( | const KoGradientBackground & | rhs | ) |
Definition at line 59 of file KoGradientBackground.cpp.
References d.
|
overridevirtual |
reimplemented from KoShapeBackground
NOTE: important hack!
Qt has different notation of QBrush::setTransform() in comparison to what SVG defines. SVG defines gradientToUser matrix to be postmultiplied by QBrush::transform(), but Qt does exactly reverse!
That most probably has been caused by the fact that Qt uses transposed matrices and someone just mistyped the stuff long ago :(
So here we basically emulate this feature by converting the gradient into QGradient::LogicalMode and doing transformations manually.
Implements KoShapeBackground.
Definition at line 97 of file KoGradientBackground.cpp.
References d.
| void KoGradientBackground::setGradient | ( | const QGradient & | gradient | ) |
Sets a new gradient. A clone of the given gradient is used.
Definition at line 84 of file KoGradientBackground.cpp.
References KoFlake::cloneGradient(), d, and gradient().
| void KoGradientBackground::setTransform | ( | const QTransform & | matrix | ) |
| QTransform KoGradientBackground::transform | ( | ) | const |
|
private |
Definition at line 62 of file KoGradientBackground.h.