QElectroTech
0.70
|
The DiagramEventInterface class isRunning() return true if action is running (do something). By default return false. More...
#include <diagrameventinterface.h>
Signals | |
void | finish () |
Public Member Functions | |
DiagramEventInterface (Diagram *diagram) | |
~DiagramEventInterface () override=0 | |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
virtual void | wheelEvent (QGraphicsSceneWheelEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
DiagramEventInterface::keyPressEvent By default, press escape key abort the curent action. More... | |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual bool | isRunning () const |
virtual void | init () |
Protected Attributes | |
Diagram * | m_diagram |
bool | m_running |
bool | m_abort |
The DiagramEventInterface class isRunning() return true if action is running (do something). By default return false.
This class is the basic interface for manage event on a diagram. To create a behavior for event diagram, we need to herite this class. This interface work like this : You need to create an interface and call diagram::setEventInterface(pointer_of_your_interface). When a diagram get an event (mouse or key) if they have an event interface, they send the event (with the status accepted to false) to the interface (for exemple mousePressEvent). If the interface do something with this event, you need to set to true the accepted status of the event, then diagram do nothing. When the interface job is done, we need to emit the signal finish(), the diagram use this signal to delete the interface. Be carreful with the destructor, diagram can at any time (even if interface is still running) delete the interface, the bool m_abort is here for that at destruction time.
Definition at line 45 of file diagrameventinterface.h.
DiagramEventInterface::DiagramEventInterface | ( | Diagram * | diagram | ) |
Definition at line 24 of file diagrameventinterface.cpp.
References m_diagram.
|
overridepure virtual |
Definition at line 32 of file diagrameventinterface.cpp.
|
signal |
|
virtual |
Reimplemented in DiagramEventAddElement, and DiagramEventAddShape.
Definition at line 78 of file diagrameventinterface.cpp.
|
virtual |
Definition at line 74 of file diagrameventinterface.cpp.
References m_running.
|
virtual |
DiagramEventInterface::keyPressEvent By default, press escape key abort the curent action.
event |
Reimplemented in DiagramEventAddElement.
Definition at line 59 of file diagrameventinterface.cpp.
References finish(), m_abort, and m_running.
Referenced by DiagramEventAddElement::keyPressEvent(), and Diagram::keyPressEvent().
|
virtual |
Definition at line 70 of file diagrameventinterface.cpp.
Referenced by Diagram::keyReleaseEvent().
|
virtual |
Reimplemented in DiagramEventAddElement, DiagramEventAddImage, and DiagramEventAddShape.
Definition at line 34 of file diagrameventinterface.cpp.
Referenced by Diagram::mouseDoubleClickEvent().
|
virtual |
Reimplemented in DiagramEventAddElement, DiagramEventAddImage, and DiagramEventAddShape.
Definition at line 42 of file diagrameventinterface.cpp.
Referenced by Diagram::mouseMoveEvent().
|
virtual |
Reimplemented in DiagramEventAddElement, DiagramEventAddImage, DiagramEventAddText, and DiagramEventAddShape.
Definition at line 38 of file diagrameventinterface.cpp.
Referenced by Diagram::mousePressEvent().
|
virtual |
Reimplemented in DiagramEventAddElement, and DiagramEventAddShape.
Definition at line 46 of file diagrameventinterface.cpp.
Referenced by Diagram::mouseReleaseEvent().
|
virtual |
Reimplemented in DiagramEventAddImage.
Definition at line 50 of file diagrameventinterface.cpp.
Referenced by Diagram::wheelEvent().
|
protected |
Definition at line 68 of file diagrameventinterface.h.
Referenced by keyPressEvent(), DiagramEventAddImage::~DiagramEventAddImage(), and DiagramEventAddShape::~DiagramEventAddShape().
|
protected |
Definition at line 66 of file diagrameventinterface.h.
Referenced by DiagramEventAddElement::addElement(), DiagramEventAddElement::buildElement(), DiagramEventAddElement::DiagramEventAddElement(), DiagramEventInterface(), DiagramEventAddShape::init(), DiagramEventAddElement::init(), DiagramEventAddShape::mouseDoubleClickEvent(), DiagramEventAddImage::mouseMoveEvent(), DiagramEventAddShape::mousePressEvent(), DiagramEventAddText::mousePressEvent(), DiagramEventAddImage::mousePressEvent(), DiagramEventAddShape::mouseReleaseEvent(), DiagramEventAddImage::openDialog(), DiagramEventAddShape::updateHelpCross(), DiagramEventAddElement::~DiagramEventAddElement(), DiagramEventAddImage::~DiagramEventAddImage(), and DiagramEventAddShape::~DiagramEventAddShape().
|
protected |
Definition at line 67 of file diagrameventinterface.h.
Referenced by DiagramEventAddElement::DiagramEventAddElement(), DiagramEventAddShape::DiagramEventAddShape(), isRunning(), keyPressEvent(), DiagramEventAddElement::mouseDoubleClickEvent(), DiagramEventAddImage::mousePressEvent(), DiagramEventAddShape::mouseReleaseEvent(), DiagramEventAddElement::mouseReleaseEvent(), DiagramEventAddImage::openDialog(), DiagramEventAddImage::~DiagramEventAddImage(), and DiagramEventAddShape::~DiagramEventAddShape().