Warning, file /education/kalzium/src/psetable/numerationitem.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 NumerationItem - Numeration Item, part of the Periodic Table Graphics View 0003 for Kalzium 0004 0005 SPDX-FileCopyrightText: 2007-2009 Marcus D. Hanwell <marcus@cryos.org> 0006 SPDX-FileCopyrightText: 2010 Etienne Rebetez <etienne.rebetez@oberwallis.ch> 0007 0008 This file is part of the Avogadro molecular editor project. 0009 For more information, see <https://avogadro.cc/> 0010 0011 SPDX-License-Identifier: LGPL-2.1-or-later 0012 */ 0013 0014 #ifndef NUMERATIONITEM_H 0015 #define NUMERATIONITEM_H 0016 0017 #include <QGraphicsItem> 0018 0019 #include "kalziumdataobject.h" 0020 #include <chemicaldataobject.h> 0021 0022 /** 0023 * @class NumerationItem 0024 * @author Marcus D. Hanwell 0025 * @author Etienne Rebetez 0026 * @brief An Numeration item, intended to display a id of the numeration row. 0027 * 0028 */ 0029 class NumerationItem : public QGraphicsObject 0030 { 0031 Q_OBJECT 0032 0033 public: 0034 /** 0035 * Constructor. Should be called with the element number for this item. The 0036 * constructor uses setData to set the element number using the key 0. This 0037 * is then used by PeriodicTable to figure out which element was clicked on. 0038 */ 0039 explicit NumerationItem(int xPosition = 0); 0040 0041 /** 0042 * Destructor. 0043 */ 0044 ~NumerationItem() override; 0045 0046 /** 0047 * @return the bounding rectangle of the element item. 0048 */ 0049 QRectF boundingRect() const override; 0050 0051 /** 0052 * @return the painter path which is also a rectangle in this case. 0053 */ 0054 QPainterPath shape() const override; 0055 0056 /** 0057 * This is where most of the action takes place. The element box is drawn 0058 * along with its symbol. 0059 */ 0060 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; 0061 0062 public Q_SLOTS: 0063 void setNumerationType(int type); 0064 0065 private: 0066 /** 0067 * Width of the elements. 0068 */ 0069 int m_width; 0070 0071 /** 0072 * Height of the elements. 0073 */ 0074 int m_height; 0075 0076 /** 0077 * The row Position of the Numeration item 0078 */ 0079 int m_xPosition; 0080 0081 /** 0082 * The numeration symbol. 0083 */ 0084 QString m_numeration; 0085 0086 /** 0087 * The color of the element. 0088 */ 0089 QColor m_color; 0090 }; 0091 0092 #endif // NUMERATIONITEM_H