QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Attributes | List of all members
DiagramEventInterface Class Referenceabstract

The DiagramEventInterface class isRunning() return true if action is running (do something). By default return false. More...

#include <diagrameventinterface.h>

Inheritance diagram for DiagramEventInterface:
Inheritance graph
Collaboration diagram for DiagramEventInterface:
Collaboration graph

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< Diagramm_diagram
 
bool m_running {false}
 
bool m_abort {false}
 

Detailed Description

The DiagramEventInterface class isRunning() return true if action is running (do something). By default return false.

USE DiagramEventInterface

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.

Constructor & Destructor Documentation

◆ DiagramEventInterface()

DiagramEventInterface::DiagramEventInterface ( Diagram diagram)

◆ ~DiagramEventInterface()

DiagramEventInterface::~DiagramEventInterface ( )
overridepure virtual

Member Function Documentation

◆ finish

void DiagramEventInterface::finish ( )
signal
Here is the caller graph for this function:

◆ init()

void DiagramEventInterface::init ( )
virtual

◆ isRunning()

bool DiagramEventInterface::isRunning ( ) const
virtual

◆ keyPressEvent()

void DiagramEventInterface::keyPressEvent ( QKeyEvent *  event)
virtual

DiagramEventInterface::keyPressEvent By default, press escape key abort the current action.

Parameters
event

Reimplemented in DiagramEventAddElement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyReleaseEvent()

void DiagramEventInterface::keyReleaseEvent ( QKeyEvent *  event)
virtual
Here is the caller graph for this function:

◆ mouseDoubleClickEvent()

void DiagramEventInterface::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
virtual

Reimplemented in DiagramEventAddElement, DiagramEventAddImage, and DiagramEventAddShape.

Here is the caller graph for this function:

◆ mouseMoveEvent()

void DiagramEventInterface::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
virtual

Reimplemented in DiagramEventAddElement, DiagramEventAddImage, and DiagramEventAddShape.

Here is the caller graph for this function:

◆ mousePressEvent()

void DiagramEventInterface::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
virtual

Reimplemented in DiagramEventAddElement, DiagramEventAddImage, DiagramEventAddShape, and DiagramEventAddText.

Here is the caller graph for this function:

◆ mouseReleaseEvent()

void DiagramEventInterface::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
virtual

Reimplemented in DiagramEventAddElement, and DiagramEventAddShape.

Here is the caller graph for this function:

◆ wheelEvent()

void DiagramEventInterface::wheelEvent ( QGraphicsSceneWheelEvent *  event)
virtual

Reimplemented in DiagramEventAddImage.

Here is the caller graph for this function:

Member Data Documentation

◆ m_abort

bool DiagramEventInterface::m_abort {false}
protected

◆ m_diagram

QPointer<Diagram> DiagramEventInterface::m_diagram
protected

◆ m_running

bool DiagramEventInterface::m_running {false}
protected

The documentation for this class was generated from the following files: