Avogadro
1.1.0
|
This class implements the view of the PeriodicTableScene. More...
#include <avogadro/periodictableview.h>
Public Slots | |
void | clearKeyPressBuffer () |
Signals | |
void | elementChanged (int element) |
Public Member Functions | |
PeriodicTableView (QWidget *parent=0) | |
~PeriodicTableView () | |
Protected Member Functions | |
bool | event (QEvent *e) |
void | mouseDoubleClickEvent (QMouseEvent *event) |
void | keyPressEvent (QKeyEvent *event) |
This class implements the view of the PeriodicTableScene.
Avogadro::PeriodicTableView::PeriodicTableView | ( | QWidget * | parent = 0 | ) | [explicit] |
Constructor - contructs a new PeriodicTableView with an internal instance of PeriodicTableScene.
References QObject::connect(), elementChanged(), QWidget::resize(), QGraphicsScene::setBackgroundBrush(), QWidget::setFixedSize(), QGraphicsScene::setItemIndexMethod(), QGraphicsView::setRenderHint(), QGraphicsView::setScene(), QGraphicsScene::setSceneRect(), QWidget::setWindowFlags(), QWidget::setWindowTitle(), and QObject::tr().
Destructor.
References QGraphicsView::scene().
void Avogadro::PeriodicTableView::clearKeyPressBuffer | ( | ) | [slot] |
This slot is called to clear the key buffer (e.g. after a delay in typing)
References QString::clear().
Referenced by keyPressEvent().
void Avogadro::PeriodicTableView::elementChanged | ( | int | element | ) | [signal] |
Signal emitted when the active element in the PeriodicTableView changes.
Referenced by PeriodicTableView().
bool Avogadro::PeriodicTableView::event | ( | QEvent * | e | ) | [protected, virtual] |
Generic event handler, currently defaults to calling parent class (included for future compatibility)
Reimplemented from QGraphicsView.
void Avogadro::PeriodicTableView::keyPressEvent | ( | QKeyEvent * | event | ) | [protected, virtual] |
Handles the keyboard events to change the active element.
Reimplemented from QGraphicsView.
References QString::append(), Avogadro::PeriodicTableScene::changeElement(), clearKeyPressBuffer(), QByteArray::data(), OpenBabel::etab, OpenBabel::OBElementTable::GetAtomicNum(), QString::isEmpty(), QString::length(), QGraphicsView::scene(), QTimer::singleShot, QKeyEvent::text(), QString::toAscii(), and QString::toInt().
void Avogadro::PeriodicTableView::mouseDoubleClickEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Double click event - select an element and hide the PeriodicTableView.
Reimplemented from QGraphicsView.
References QWidget::close().