kalzium
Avogadro::ElementItem Class Reference
#include <periodictableview.h>

Detailed Description
Hanwell An element item intended to display a single element box.
This class implements a QGraphicsItem for displaying single elements in a perdiodic table. It currently allows the setting of the proton number and gets all other information from OpenBabel.
Definition at line 46 of file libavogadro-kalzium/src/periodictableview.h.
Public Member Functions | |
| QRectF | boundingRect () const |
| ElementItem (int elementNumber=0) | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
| QPainterPath | shape () const |
| ~ElementItem () | |
Constructor & Destructor Documentation
| Avogadro::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.
Definition at line 48 of file libavogadro-kalzium/src/periodictableview.cpp.
| Avogadro::ElementItem::~ElementItem | ( | ) |
Definition at line 65 of file libavogadro-kalzium/src/periodictableview.cpp.
Member Function Documentation
| QRectF Avogadro::ElementItem::boundingRect | ( | ) | const |
- Returns:
- the bounding rectangle of the element item.
Definition at line 70 of file libavogadro-kalzium/src/periodictableview.cpp.
| void Avogadro::ElementItem::paint | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option, | |||
| QWidget * | widget | |||
| ) |
This is where most of the action takes place.
The element box is drawn along with its symbol.
Reimplemented from QGraphicsItem.
Definition at line 82 of file libavogadro-kalzium/src/periodictableview.cpp.
| QPainterPath Avogadro::ElementItem::shape | ( | ) | const |
- Returns:
- the painter path which is also a rectangle in this case.
Definition at line 75 of file libavogadro-kalzium/src/periodictableview.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference