AvogadroLibs 1.98.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ElementItem Class Reference
Inheritance diagram for ElementItem:

Public Member Functions

 ElementItem (int elementNumber=0)
 
QRectF boundingRect () const override
 
QPainterPath shape () const override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 

Constructor & Destructor Documentation

◆ ElementItem()

ElementItem ( int  elementNumber = 0)

Constructor. Should be called with the element number for this item. The constructor uses setData to set the element number using the key 0. This is then used by PeriodicTable to figure out which element was clicked on.

Member Function Documentation

◆ boundingRect()

QRectF boundingRect ( ) const
override
Returns
the bounding rectangle of the element item.

◆ shape()

QPainterPath shape ( ) const
override
Returns
the painter path which is also a rectangle in this case.

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
override

This is where most of the action takes place. The element box is drawn along with its symbol.


The documentation for this class was generated from the following file: