Avogadro
1.1.0
|
An item box displaying more detailed information on the element. More...
#include <elementdetail_p.h>
Public Slots | |
void | elementChanged (int element) |
Public Member Functions | |
ElementDetail (int elementNumber=0) | |
QRectF | boundingRect () const |
QPainterPath | shape () const |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
An item box displaying more detailed information on the element.
Avogadro::ElementDetail::ElementDetail | ( | int | elementNumber = 0 | ) |
Constructor. Should be called with the element number for this item.
QRectF Avogadro::ElementDetail::boundingRect | ( | ) | const |
Reimplemented from QGraphicsItem.
void Avogadro::ElementDetail::elementChanged | ( | int | element | ) | [slot] |
This slot can be used to indicate the active element has changed which will cause this item to redraw with the details of the new element.
References QGraphicsItem::update().
void Avogadro::ElementDetail::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, proton number, mass and full name.
Reimplemented from QGraphicsItem.
References QString::arg(), QPainter::drawRect(), QPainter::drawText(), OpenBabel::etab, OpenBabel::OBElementTable::GetRGB(), OpenBabel::OBElementTable::GetSymbol(), QFontMetrics::height(), QObject::name(), QString::number(), QPainter::setBrush(), QPainter::setFont(), QPainter::setPen(), QFont::setPixelSize(), QColor::setRgbF(), and QFontMetrics::width().
QPainterPath Avogadro::ElementDetail::shape | ( | ) | const [virtual] |
Reimplemented from QGraphicsItem.
References QPainterPath::addRect().