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

#include <elementsmover.h>

Collaboration diagram for ElementsMover:
Collaboration graph

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
 
Diagramm_diagram {nullptr}
 
QGraphicsItem * m_movement_driver {nullptr}
 
DiagramContent m_moved_content
 
QPointer< QStatusBar > m_status_bar
 

Detailed Description

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().

Constructor & Destructor Documentation

◆ ElementsMover() [1/2]

ElementsMover::ElementsMover ( )

◆ ~ElementsMover()

ElementsMover::~ElementsMover ( )
virtual

◆ ElementsMover() [2/2]

ElementsMover::ElementsMover ( const ElementsMover )
private

Member Function Documentation

◆ beginMovement()

int ElementsMover::beginMovement ( Diagram diagram,
QGraphicsItem *  driver_item = nullptr 
)

ElementsMover::beginMovement Start a new movement.

Parameters
diagramdiagram where the movement is applied
driver_itemitem moved by mouse and don't be moved by Element mover
Returns
the numbers of items to be moved or -1 if movement can't be init.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ continueMovement()

void ElementsMover::continueMovement ( const QPointF &  movement)

ElementsMover::continueMovement Add a move to the current movement.

Parameters
movementmovement to applied
Here is the call graph for this function:
Here is the caller graph for this function:

◆ endMovement()

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.

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

◆ isReady()

bool ElementsMover::isReady ( ) const

ElementsMover::isReady.

Returns
True if this element mover is ready to be used. A element mover is ready when the previous managed movement is finish.

Member Data Documentation

◆ m_current_movement

QPointF ElementsMover::m_current_movement
private

◆ m_diagram

Diagram* ElementsMover::m_diagram {nullptr}
private

◆ m_moved_content

DiagramContent ElementsMover::m_moved_content
private

◆ m_movement_driver

QGraphicsItem* ElementsMover::m_movement_driver {nullptr}
private

◆ m_movement_running

bool ElementsMover::m_movement_running {false}
private

◆ m_status_bar

QPointer<QStatusBar> ElementsMover::m_status_bar
private

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