File indexing completed on 2022-09-27 12:24:07

0001 /*
0002     SPDX-FileCopyrightText: 2004, 2005, 2006, 2007 Carsten Niehaus <cniehaus@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef DETAILEDGRAPHICALOVERVIEW_H
0007 #define DETAILEDGRAPHICALOVERVIEW_H
0008 
0009 #include "kalziumelementproperty.h"
0010 #include <QWidget>
0011 
0012 class Element;
0013 
0014 /**
0015  * @brief The widget which displays the most important information
0016  *
0017  * In one widget like a lot people know it from school
0018  *
0019  * @author Carsten Niehaus
0020  */
0021 class DetailedGraphicalOverview : public QWidget
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     /**
0027      * Construct a new DetailedGraphicalOverview.
0028      *
0029      * @param parent the parent of this widget
0030      */
0031     explicit DetailedGraphicalOverview(QWidget *parent);
0032 
0033 public Q_SLOTS:
0034     /**
0035      * Set @p el as the element to be drawn
0036      */
0037     void setElement(int el);
0038 
0039 private:
0040     /**
0041      * Set the background color to @p bgColor.
0042      */
0043     void setBackgroundColor(QColor bgColor);
0044 
0045     /**
0046      * the element whose data will be used
0047      */
0048     Element *m_element = nullptr;
0049 
0050     /**
0051      * The background color.
0052      */
0053     QBrush m_backgroundBrush;
0054 
0055 protected:
0056     void paintEvent(QPaintEvent *) override;
0057 };
0058 
0059 #endif // DETAILEDGRAPHICALOVERVIEW_H