QElectroTech 0.100.0-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. | |
~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 |
Element * | m_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< Diagram > | m_diagram |
bool | m_running {false} |
bool | m_abort {false} |
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 |
|
private |