Krita Source Code Documentation
Loading...
Searching...
No Matches
KoGradientBackground.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KOGRADIENTBACKGROUND_H
8#define KOGRADIENTBACKGROUND_H
9
10#include "KoShapeBackground.h"
11#include "kritaflake_export.h"
12
13#include <QTransform>
14#include <QSharedDataPointer>
15
16class QGradient;
17
19class KRITAFLAKE_EXPORT KoGradientBackground : public KoShapeBackground
20{
21public:
26 explicit KoGradientBackground(QGradient *gradient, const QTransform &matrix = QTransform());
27
32 explicit KoGradientBackground(const QGradient &gradient, const QTransform &matrix = QTransform());
33
35 ~KoGradientBackground() override;
36
37 // Work around MSVC inability to generate copy ops with QSharedDataPointer.
40
41 bool compareTo(const KoShapeBackground *other) const override;
42
44 void setTransform(const QTransform &matrix);
45
47 QTransform transform() const;
48
53 void setGradient(const QGradient &gradient);
54
56 const QGradient *gradient() const;
57
59 void paint(QPainter &painter, const QPainterPath &fillPath) const override;
60private:
61 class Private;
62 QSharedDataPointer<Private> d;
63};
64
65#endif // KOGRADIENTBACKGROUND_H
A gradient shape background.
QSharedDataPointer< Private > d
virtual bool compareTo(const KoShapeBackground *other) const =0
virtual void paint(QPainter &painter, const QPainterPath &fillPath) const =0
Paints the background using the given fill path.