QElectroTech 0.100.0-dev
|
#include <elementsmover.h>
Public Member Functions | |
ElementsMover () | |
ElementsMover::ElementsMover Constructor. | |
virtual | ~ElementsMover () |
ElementsMover::~ElementsMover Destructor. | |
bool | isReady () const |
ElementsMover::isReady. | |
int | beginMovement (Diagram *, QGraphicsItem *=nullptr) |
ElementsMover::beginMovement Start a new movement. | |
void | continueMovement (const QPointF &) |
ElementsMover::continueMovement Add a move to the current movement. | |
void | endMovement () |
ElementsMover::endMovement Ended the current movement by creating an undo added to the undostack of the diagram. If there is only one element moved, we try to auto-connect new conductor from this element and other possible element. | |
Private Member Functions | |
ElementsMover (const ElementsMover &) | |
Private Attributes | |
bool | m_movement_running {false} |
QPointF | m_current_movement |
Diagram * | m_diagram {nullptr} |
QGraphicsItem * | m_movement_driver {nullptr} |
DiagramContent | m_moved_content |
QPointer< QStatusBar > | m_status_bar |
This class manages the interactive movement of different items (elements, conductors, text items etc...) on a particular diagram.
A movement work in 3 steps: 1: beginMovement -> init a new movement 2: continueMovement -> continue the current movement 3: endMovement -> finish the current movement
A movement in progress must finish before starting a new movement. We can know if element mover is ready for a new movement by calling isReady().
ElementsMover::ElementsMover | ( | ) |
ElementsMover::ElementsMover Constructor.
|
virtual |
ElementsMover::~ElementsMover Destructor.
|
private |
int ElementsMover::beginMovement | ( | Diagram * | diagram, |
QGraphicsItem * | driver_item = nullptr |
||
) |
ElementsMover::beginMovement Start a new movement.
diagram | diagram where the movement is applied |
driver_item | item moved by mouse and don't be moved by Element mover |
void ElementsMover::continueMovement | ( | const QPointF & | movement | ) |
ElementsMover::continueMovement Add a move to the current movement.
movement | movement to applied |
void ElementsMover::endMovement | ( | ) |
ElementsMover::endMovement Ended the current movement by creating an undo added to the undostack of the diagram. If there is only one element moved, we try to auto-connect new conductor from this element and other possible element.
bool ElementsMover::isReady | ( | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |