File indexing completed on 2024-04-21 07:49:44

0001 /*
0002     This file is part of the KDE project "KLines"
0003 
0004     SPDX-FileCopyrightText: 2007 Dmitry Suzdalev <dimsuz@gmail.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef PREVIEWITEM_H
0010 #define PREVIEWITEM_H
0011 
0012 #include <QGraphicsItem>
0013 #include "commondefs.h"
0014 
0015 class PreviewItem : public QGraphicsItem
0016 {
0017 public:
0018     explicit PreviewItem( QGraphicsScene* scene );
0019 
0020     /**
0021      * Sets colors to be displayed
0022      */
0023     void setPreviewColors( const QList<BallColor>& colors );
0024 
0025     // reimplemented functions
0026     void paint(QPainter* p, const QStyleOptionGraphicsItem* option,  QWidget* widget = nullptr) override;
0027     QRectF boundingRect() const override;
0028 private:
0029     QList<BallColor> m_colors;
0030 };
0031 
0032 #endif