File indexing completed on 2024-04-14 03:59:20

0001 /*
0002     SPDX-FileCopyrightText: 2006, 2007 Nicolas Roffet <nicolas-kde@roffet.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KBBLEVELCONFIGURATIONPREVIEW_H
0008 #define KBBLEVELCONFIGURATIONPREVIEW_H
0009 
0010 
0011 
0012 #include <QGraphicsView>
0013 #include <QList>
0014 
0015 
0016 class KBBGraphicsItem;
0017 class KBBGraphicsItemBlackBox;
0018 class KBBThemeManager;
0019 
0020 
0021 
0022 /**
0023  * @brief Widget with the preview of the field in the configuration widget
0024  */
0025 class KBBLevelConfigurationPreview : public QGraphicsView
0026 {
0027     Q_OBJECT
0028 
0029     public:
0030         KBBLevelConfigurationPreview(QWidget *parent, KBBThemeManager* themeManager);
0031 
0032 
0033     public Q_SLOTS:
0034         void preview(int balls, int columns, int rows);
0035 
0036 
0037     protected:
0038         void drawBackground(QPainter* painter, const QRectF&) override;
0039 
0040 
0041     private:
0042         QGraphicsView* m_view;
0043         QList<KBBGraphicsItem*> m_balls;
0044         KBBGraphicsItemBlackBox* m_blackbox;
0045         KBBThemeManager* m_themeManager;
0046 
0047 
0048     private Q_SLOTS:
0049         void resizeEvent(QResizeEvent*) override;
0050 };
0051 
0052 
0053 #endif //KSIMILILEVELCONFIGURATIONPREVIEW_H