File indexing completed on 2023-10-03 03:04:13
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 <QWidget> 0010 0011 class Element; 0012 0013 /** 0014 * @brief The widget which displays the most important information 0015 * 0016 * In one widget like a lot people know it from school 0017 * 0018 * @author Carsten Niehaus 0019 */ 0020 class DetailedGraphicalOverview : public QWidget 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 /** 0026 * Construct a new DetailedGraphicalOverview. 0027 * 0028 * @param parent the parent of this widget 0029 */ 0030 explicit DetailedGraphicalOverview(QWidget *parent); 0031 0032 public Q_SLOTS: 0033 /** 0034 * Set @p el as the element to be drawn 0035 */ 0036 void setElement(int el); 0037 0038 private: 0039 /** 0040 * Set the background color to @p bgColor. 0041 */ 0042 void setBackgroundColor(QColor bgColor); 0043 0044 /** 0045 * the element whose data will be used 0046 */ 0047 Element *m_element = nullptr; 0048 0049 /** 0050 * The background color. 0051 */ 0052 QBrush m_backgroundBrush; 0053 0054 protected: 0055 void paintEvent(QPaintEvent *) override; 0056 }; 0057 0058 #endif // DETAILEDGRAPHICALOVERVIEW_H