Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorBackground.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 KOCOLORBACKGROUND_H
8#define KOCOLORBACKGROUND_H
9
10#include "KoShapeBackground.h"
11#include "kritaflake_export.h"
12#include <Qt>
13#include <QSharedDataPointer>
14
15class KoColorBackgroundPrivate;
16class QColor;
17class QBrush;
18
20class KRITAFLAKE_EXPORT KoColorBackground : public KoShapeBackground
21{
22public:
24
26 explicit KoColorBackground(const QColor &color, Qt::BrushStyle style = Qt::SolidPattern);
27
28 ~KoColorBackground() override;
29
30 // Work around MSVC inability to generate copy ops with QSharedDataPointer.
32 KoColorBackground &operator=(const KoColorBackground &);
33
34 bool compareTo(const KoShapeBackground *other) const override;
35
37 QColor color() const;
38
40 void setColor(const QColor &color);
41
43 Qt::BrushStyle style() const;
44
45 QBrush brush() const;
46
47 // reimplemented from KoShapeBackground
48 void paint(QPainter &painter, const QPainterPath &fillPath) const override;
49
50private:
51 class Private;
52 QSharedDataPointer<Private> d;
53};
54
55#endif // KOCOLORBACKGROUND_H
A simple solid color 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.