Avogadro
1.1.0
|
This class encapsulates the scene, all items are contained in it. More...
#include <periodictablescene_p.h>
Public Slots | |
void | changeElement (int element) |
Signals | |
void | elementChanged (int element) |
Public Member Functions | |
PeriodicTableScene (QObject *parent=0) | |
Protected Member Functions | |
bool | event (QEvent *e) |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
This class encapsulates the scene, all items are contained in it.
Avogadro::PeriodicTableScene::PeriodicTableScene | ( | QObject * | parent = 0 | ) |
Constructor.
References QGraphicsScene::addItem(), QObject::connect(), elementChanged(), QGraphicsScene::height(), QGraphicsItem::setPos(), and QGraphicsScene::width().
void Avogadro::PeriodicTableScene::changeElement | ( | int | element | ) | [slot] |
This slot is called when an element is changed. (e.g., by keyboard or code)
References QGraphicsItem::data(), elementChanged(), QGraphicsScene::items(), QGraphicsItem::setSelected(), and QVariant::toInt().
Referenced by Avogadro::PeriodicTableView::keyPressEvent().
void Avogadro::PeriodicTableScene::elementChanged | ( | int | element | ) | [signal] |
This signal is emitted when an element item is clicked.
Referenced by changeElement(), mousePressEvent(), and PeriodicTableScene().
bool Avogadro::PeriodicTableScene::event | ( | QEvent * | e | ) | [protected, virtual] |
Generic event handler, currently defaults to calling parent class (included for future compatibility)
Reimplemented from QGraphicsScene.
void Avogadro::PeriodicTableScene::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected, virtual] |
Not used at present.
Reimplemented from QGraphicsScene.
void Avogadro::PeriodicTableScene::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected, virtual] |
Handles the mouse press events to change the active element.
Reimplemented from QGraphicsScene.
References QGraphicsSceneMouseEvent::button(), QGraphicsItem::data(), elementChanged(), QGraphicsScene::itemAt(), QGraphicsSceneMouseEvent::scenePos(), and QVariant::toInt().
void Avogadro::PeriodicTableScene::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected, virtual] |
Not used at present.
Reimplemented from QGraphicsScene.