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

The MoveGraphicsItemCommand class An undo command used for move item(s) in a diagram. More...

#include <movegraphicsitemcommand.h>

Inherits QUndoCommand.

Collaboration diagram for MoveGraphicsItemCommand:
Collaboration graph

Public Member Functions

 MoveGraphicsItemCommand (Diagram *diagram, const DiagramContent &content, const QPointF &movement, QUndoCommand *parent=nullptr)
 MoveGraphicsItemCommand::MoveGraphicsItemCommand.
 
 ~MoveGraphicsItemCommand ()
 
void undo () override
 MoveGraphicsItemCommand::undo Reimplemented from QUndoCommand::undo()
 
void redo () override
 MoveGraphicsItemCommand::redo Reimplemented from QUndoCommand::redo()
 

Private Member Functions

 MoveGraphicsItemCommand (const MoveGraphicsItemCommand &)
 
void move (const QPointF &movement)
 MoveGraphicsItemCommand::move Apply movement to items of m_content.
 
void setupAnimation (QObject *target, const QByteArray &property_name, const QVariant &start, const QVariant &end)
 MoveGraphicsItemCommand::setupAnimation Create the animation used for the movement.
 

Private Attributes

QPointer< Diagramm_diagram
 
DiagramContent m_content
 
const QPointF m_movement
 
QParallelAnimationGroup m_anim_group
 
bool m_first_redo {true}
 

Detailed Description

The MoveGraphicsItemCommand class An undo command used for move item(s) in a diagram.

Constructor & Destructor Documentation

◆ MoveGraphicsItemCommand() [1/2]

MoveGraphicsItemCommand::MoveGraphicsItemCommand ( Diagram diagram,
const DiagramContent content,
const QPointF &  movement,
QUndoCommand *  parent = nullptr 
)

MoveGraphicsItemCommand::MoveGraphicsItemCommand.

Parameters
diagram: Diagram where the movement occur
content: content aka QGraphicsItem to move
movement: the movement to apply
parent: parent undo command
Here is the call graph for this function:

◆ ~MoveGraphicsItemCommand()

MoveGraphicsItemCommand::~MoveGraphicsItemCommand ( )
inline

◆ MoveGraphicsItemCommand() [2/2]

MoveGraphicsItemCommand::MoveGraphicsItemCommand ( const MoveGraphicsItemCommand )
private

Member Function Documentation

◆ move()

void MoveGraphicsItemCommand::move ( const QPointF &  movement)
private

MoveGraphicsItemCommand::move Apply movement to items of m_content.

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

◆ redo()

void MoveGraphicsItemCommand::redo ( )
override

MoveGraphicsItemCommand::redo Reimplemented from QUndoCommand::redo()

Here is the call graph for this function:

◆ setupAnimation()

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

MoveGraphicsItemCommand::setupAnimation Create the animation used for the movement.

See also
QPropertyAnimation.
Parameters
target
property_name
start
end
Here is the caller graph for this function:

◆ undo()

void MoveGraphicsItemCommand::undo ( )
override

MoveGraphicsItemCommand::undo Reimplemented from QUndoCommand::undo()

Member Data Documentation

◆ m_anim_group

QParallelAnimationGroup MoveGraphicsItemCommand::m_anim_group
private

◆ m_content

DiagramContent MoveGraphicsItemCommand::m_content
private

◆ m_diagram

QPointer<Diagram> MoveGraphicsItemCommand::m_diagram
private

◆ m_first_redo

bool MoveGraphicsItemCommand::m_first_redo {true}
private

◆ m_movement

const QPointF MoveGraphicsItemCommand::m_movement
private

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