QElectroTech  0.70
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MoveElementsCommand Class Reference

#include <diagramcommands.h>

Public Member Functions

 MoveElementsCommand (Diagram *, const DiagramContent &, const QPointF &m, QUndoCommand *=nullptr)
 MoveElementsCommand::MoveElementsCommand Constructor. More...
 
 ~MoveElementsCommand () override
 MoveElementsCommand::~MoveElementsCommand Destructor. More...
 
void undo () override
 MoveElementsCommand::undo. More...
 
void redo () override
 MoveElementsCommand::redo. More...
 
virtual void move (const QPointF &)
 MoveElementsCommand::move Move item and conductor to . More...
 

Private Member Functions

 MoveElementsCommand (const MoveElementsCommand &)
 
void setupAnimation (QObject *target, const QByteArray &propertyName, const QVariant &start, const QVariant &end)
 MoveElementsCommand::setupAnimation Set up the animation for this undo command. More...
 

Private Attributes

Diagramdiagram
 diagram the movement takes place on. More...
 
DiagramContent content_to_move
 moved content More...
 
QPointF movement
 applied movement More...
 
QParallelAnimationGroup * m_anim_group
 animation group More...
 
bool first_redo
 prevent the first call to redo() More...
 

Detailed Description

This command moves some content on a particular diagram.

Definition at line 125 of file diagramcommands.h.

Constructor & Destructor Documentation

◆ MoveElementsCommand() [1/2]

MoveElementsCommand::MoveElementsCommand ( Diagram dia,
const DiagramContent diagram_content,
const QPointF &  m,
QUndoCommand *  parent = nullptr 
)

MoveElementsCommand::MoveElementsCommand Constructor.

Parameters
diadiagram
diagram_contentdiagram content (contain all items to be moved)
mmovement to applied
parentparent undo command

Definition at line 172 of file diagramcommands.cpp.

References DiagramContent::ConductorsToMove, DiagramContent::ConductorsToUpdate, content_to_move, DiagramContent::Elements, DiagramContent::ElementTextFields, DiagramContent::Images, DiagramContent::sentence(), DiagramContent::Shapes, DiagramContent::TextFields, and QET::Icons::tr.

◆ ~MoveElementsCommand()

MoveElementsCommand::~MoveElementsCommand ( )
override

MoveElementsCommand::~MoveElementsCommand Destructor.

Definition at line 209 of file diagramcommands.cpp.

References m_anim_group.

◆ MoveElementsCommand() [2/2]

MoveElementsCommand::MoveElementsCommand ( const MoveElementsCommand )
private

Member Function Documentation

◆ move()

void MoveElementsCommand::move ( const QPointF &  actual_movement)
virtual

MoveElementsCommand::move Move item and conductor to .

Parameters
actual_movementmovement to be applied

Definition at line 244 of file diagramcommands.cpp.

References content_to_move, DiagramContent::items(), DiagramContent::m_conductors_to_move, DiagramContent::m_conductors_to_update, Conductor::pos, and setupAnimation().

Referenced by redo().

◆ redo()

void MoveElementsCommand::redo ( )
override

◆ setupAnimation()

void MoveElementsCommand::setupAnimation ( QObject *  target,
const QByteArray &  propertyName,
const QVariant &  start,
const QVariant &  end 
)
private

MoveElementsCommand::setupAnimation Set up the animation for this undo command.

Parameters
targetobject to anim
propertyNameproperty to animate
startvalue at start
endvalue at end

Definition at line 284 of file diagramcommands.cpp.

References m_anim_group.

Referenced by move().

◆ undo()

void MoveElementsCommand::undo ( )
override

MoveElementsCommand::undo.

Definition at line 216 of file diagramcommands.cpp.

References diagram, and m_anim_group.

Member Data Documentation

◆ content_to_move

DiagramContent MoveElementsCommand::content_to_move
private

moved content

Definition at line 147 of file diagramcommands.h.

Referenced by move(), and MoveElementsCommand().

◆ diagram

Diagram* MoveElementsCommand::diagram
private

diagram the movement takes place on.

Definition at line 145 of file diagramcommands.h.

Referenced by redo(), and undo().

◆ first_redo

bool MoveElementsCommand::first_redo
private

prevent the first call to redo()

Definition at line 153 of file diagramcommands.h.

Referenced by redo().

◆ m_anim_group

QParallelAnimationGroup* MoveElementsCommand::m_anim_group
private

animation group

Definition at line 151 of file diagramcommands.h.

Referenced by redo(), setupAnimation(), undo(), and ~MoveElementsCommand().

◆ movement

QPointF MoveElementsCommand::movement
private

applied movement

Definition at line 149 of file diagramcommands.h.

Referenced by redo().


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