QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DiagramEventAddElement Class Reference

The DiagramEventAddElement class This diagram event add a new element, for each left click button at the position of click. Space key rotate current element by 90°, right click button finish this event. More...

#include <diagrameventaddelement.h>

Inheritance diagram for DiagramEventAddElement:
Inheritance graph
Collaboration diagram for DiagramEventAddElement:
Collaboration graph

Public Member Functions

 DiagramEventAddElement (ElementsLocation &location, Diagram *diagram, QPointF pos=QPointF(0, 0))
 DiagramEventAddElement::DiagramEventAddElement Defaut constructor.
 
 ~DiagramEventAddElement () override
 DiagramEventAddElement::~DiagramEventAddElement Destructor Enable context menu for each view of diagram.
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 DiagramEventAddElement::mouseMoveEvent Move the element to new pos of mouse the event is always accepted.
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 DiagramEventAddElement::mousePressEvent Do nothing, but return true for not transit the event to other thing in diagram. the event is always accepted.
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 DiagramEventAddElement::mouseReleaseEvent Right button finish this event (isRunning = false) and emit finish. Left button add an element to diagram the event is always accepted.
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 DiagramEventAddElement::mouseDoubleClickEvent If mouse left double clic, finish this event (isRunning = false) and emit finish the event is always accepted.
 
void keyPressEvent (QKeyEvent *event) override
 DiagramEventAddElement::keyPressEvent Press space key rotate the element to 90° (return true) else call DiagramEventInterface::keyPressEvent(event), and return the value.
 
void init () override
 DiagramEventAddElement::init Init this event.
 
- Public Member Functions inherited from DiagramEventInterface
 DiagramEventInterface (Diagram *diagram)
 
 ~DiagramEventInterface () override=0
 
virtual void wheelEvent (QGraphicsSceneWheelEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual bool isRunning () const
 

Private Member Functions

bool buildElement ()
 DiagramEventAddElement::buildElement Build the element, if the element is build successfully, we return true, otherwise false.
 
void addElement ()
 DiagramEventAddElement::addElement Add an element at the current pos en current rotation, if project autoconductor option is enable, and the element can be wired, we do it.
 

Private Attributes

ElementsLocation m_location
 
Elementm_element
 
QString m_integrate_path
 
QPointer< QStatusBar > m_status_bar
 

Additional Inherited Members

- Signals inherited from DiagramEventInterface
void finish ()
 
- Protected Attributes inherited from DiagramEventInterface
QPointer< Diagramm_diagram
 
bool m_running {false}
 
bool m_abort {false}
 

Detailed Description

The DiagramEventAddElement class This diagram event add a new element, for each left click button at the position of click. Space key rotate current element by 90°, right click button finish this event.

Constructor & Destructor Documentation

◆ DiagramEventAddElement()

DiagramEventAddElement::DiagramEventAddElement ( ElementsLocation location,
Diagram diagram,
QPointF  pos = QPointF(0,0) 
)

DiagramEventAddElement::DiagramEventAddElement Defaut constructor.

Parameters
location:location of diagram
diagram: diagram owner of this event
pos: first pos of item ( optional, by defaut QPointF(0,0) )
Here is the call graph for this function:

◆ ~DiagramEventAddElement()

DiagramEventAddElement::~DiagramEventAddElement ( )
override

DiagramEventAddElement::~DiagramEventAddElement Destructor Enable context menu for each view of diagram.

Member Function Documentation

◆ addElement()

void DiagramEventAddElement::addElement ( )
private

DiagramEventAddElement::addElement Add an element at the current pos en current rotation, if project autoconductor option is enable, and the element can be wired, we do it.

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

◆ buildElement()

bool DiagramEventAddElement::buildElement ( )
private

DiagramEventAddElement::buildElement Build the element, if the element is build successfully, we return true, otherwise false.

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

◆ init()

void DiagramEventAddElement::init ( )
overridevirtual

DiagramEventAddElement::init Init this event.

Reimplemented from DiagramEventInterface.

Here is the caller graph for this function:

◆ keyPressEvent()

void DiagramEventAddElement::keyPressEvent ( QKeyEvent *  event)
overridevirtual

DiagramEventAddElement::keyPressEvent Press space key rotate the element to 90° (return true) else call DiagramEventInterface::keyPressEvent(event), and return the value.

Parameters
event

Reimplemented from DiagramEventInterface.

Here is the call graph for this function:

◆ mouseDoubleClickEvent()

void DiagramEventAddElement::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
overridevirtual

DiagramEventAddElement::mouseDoubleClickEvent If mouse left double clic, finish this event (isRunning = false) and emit finish the event is always accepted.

Parameters
event

Reimplemented from DiagramEventInterface.

Here is the call graph for this function:

◆ mouseMoveEvent()

void DiagramEventAddElement::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overridevirtual

DiagramEventAddElement::mouseMoveEvent Move the element to new pos of mouse the event is always accepted.

Parameters
event

Reimplemented from DiagramEventInterface.

Here is the call graph for this function:

◆ mousePressEvent()

void DiagramEventAddElement::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overridevirtual

DiagramEventAddElement::mousePressEvent Do nothing, but return true for not transit the event to other thing in diagram. the event is always accepted.

Parameters
event

Reimplemented from DiagramEventInterface.

◆ mouseReleaseEvent()

void DiagramEventAddElement::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overridevirtual

DiagramEventAddElement::mouseReleaseEvent Right button finish this event (isRunning = false) and emit finish. Left button add an element to diagram the event is always accepted.

Parameters
event

Reimplemented from DiagramEventInterface.

Here is the call graph for this function:

Member Data Documentation

◆ m_element

Element* DiagramEventAddElement::m_element
private

◆ m_integrate_path

QString DiagramEventAddElement::m_integrate_path
private

◆ m_location

ElementsLocation DiagramEventAddElement::m_location
private

◆ m_status_bar

QPointer<QStatusBar> DiagramEventAddElement::m_status_bar
private

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