File indexing completed on 2024-05-12 16:02:30

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef KOCHECKERBOARDPAINTER_H
0008 #define KOCHECKERBOARDPAINTER_H
0009 
0010 #include <QPixmap>
0011 #include <QColor>
0012 #include "kritawidgetutils_export.h"
0013 
0014 class QPainter;
0015 
0016 class KRITAWIDGETUTILS_EXPORT KoCheckerBoardPainter
0017 {
0018 public:
0019     explicit KoCheckerBoardPainter(int checkerSize);
0020     void setCheckerColors(const QColor &lightColor, const QColor &darkColor);
0021     void setCheckerSize(int checkerSize);
0022     void paint(QPainter &painter, const QRectF &rect, const QPointF &patternOrigin) const;
0023     void paint(QPainter &painter, const QRectF &rect) const;
0024 
0025 private:
0026     void createChecker();
0027     int m_checkerSize;
0028     QPixmap m_checker;
0029     QColor m_lightColor;
0030     QColor m_darkColor;
0031 };
0032 
0033 #endif // KOCHECKERBOARDPAINTER_H