QElectroTech 0.100.0-dev
|
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 current action. | |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual bool | isRunning () const |
virtual void | init () |
Protected Attributes | |
QPointer< Diagram > | m_diagram |
bool | m_running {false} |
bool | m_abort {false} |
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 example 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.
DiagramEventInterface::DiagramEventInterface | ( | Diagram * | diagram | ) |
|
overridepure virtual |
|
signal |
|
virtual |
Reimplemented in DiagramEventAddElement, and DiagramEventAddShape.
|
virtual |
|
virtual |
DiagramEventInterface::keyPressEvent By default, press escape key abort the current action.
event |
Reimplemented in DiagramEventAddElement.
|
virtual |
|
virtual |
Reimplemented in DiagramEventAddElement, DiagramEventAddImage, and DiagramEventAddShape.
|
virtual |
Reimplemented in DiagramEventAddElement, DiagramEventAddImage, and DiagramEventAddShape.
|
virtual |
Reimplemented in DiagramEventAddElement, DiagramEventAddImage, DiagramEventAddShape, and DiagramEventAddText.
|
virtual |
Reimplemented in DiagramEventAddElement, and DiagramEventAddShape.
|
virtual |
|
protected |
|
protected |
|
protected |