QElectroTech
0.8-dev
|
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>
Public Member Functions | |
DiagramEventAddElement (ElementsLocation &location, Diagram *diagram, QPointF pos=QPointF(0, 0)) | |
DiagramEventAddElement::DiagramEventAddElement Defaut constructor. More... | |
~DiagramEventAddElement () override | |
DiagramEventAddElement::~DiagramEventAddElement Destructor Enable context menu for each view of diagram. More... | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
DiagramEventAddElement::mouseMoveEvent Move the element to new pos of mouse the event is always accepted. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | init () override |
DiagramEventAddElement::init Init this event. More... | |
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. More... | |
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. More... | |
Private Attributes | |
ElementsLocation | m_location |
Element * | m_element |
QString | m_integrate_path |
Additional Inherited Members | |
Signals inherited from DiagramEventInterface | |
void | finish () |
Protected Attributes inherited from DiagramEventInterface | |
Diagram * | m_diagram |
bool | m_running |
bool | m_abort |
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.
DiagramEventAddElement::DiagramEventAddElement | ( | ElementsLocation & | location, |
Diagram * | diagram, | ||
QPointF | pos = QPointF(0,0) |
||
) |
DiagramEventAddElement::DiagramEventAddElement Defaut constructor.
location | :location of diagram |
diagram | : diagram owner of this event |
pos | : first pos of item ( optional, by defaut QPointF(0,0) ) |
|
override |
DiagramEventAddElement::~DiagramEventAddElement Destructor Enable context menu for each view of diagram.
|
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.
|
private |
DiagramEventAddElement::buildElement Build the element, if the element is build successfully, we return true, otherwise false.
|
overridevirtual |
DiagramEventAddElement::init Init this event.
Reimplemented from DiagramEventInterface.
|
overridevirtual |
DiagramEventAddElement::keyPressEvent Press space key rotate the element to 90° (return true) else call DiagramEventInterface::keyPressEvent(event), and return the value.
event |
Reimplemented from DiagramEventInterface.
|
overridevirtual |
DiagramEventAddElement::mouseDoubleClickEvent If mouse left double clic, finish this event (isRunning = false) and emit finish the event is always accepted.
event |
Reimplemented from DiagramEventInterface.
|
overridevirtual |
DiagramEventAddElement::mouseMoveEvent Move the element to new pos of mouse the event is always accepted.
event |
Reimplemented from DiagramEventInterface.
|
overridevirtual |
DiagramEventAddElement::mousePressEvent Do nothing, but return true for not transit the event to other thing in diagram. the event is always accepted.
event |
Reimplemented from DiagramEventInterface.
|
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.
event |
Reimplemented from DiagramEventInterface.
|
private |
|
private |
|
private |