mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 00:30:53 +01:00
Revamp code
-Move MoveElementsCommand class from diagramcommands file to movegraphicsitemcommand file. -Rename the to class MoveGraphicsItemCommand. -Minor code change to make it more modern.
This commit is contained in:
@@ -69,45 +69,6 @@ class CutDiagramCommand : public DeleteQGraphicsItemCommand {
|
||||
CutDiagramCommand(const CutDiagramCommand &);
|
||||
};
|
||||
|
||||
/**
|
||||
@brief The MoveElementsCommand class
|
||||
This command moves some content on a particular diagram.
|
||||
*/
|
||||
class MoveElementsCommand : public QUndoCommand {
|
||||
// constructors, destructor
|
||||
public:
|
||||
MoveElementsCommand(Diagram *, const DiagramContent &,
|
||||
const QPointF &m, QUndoCommand * = nullptr);
|
||||
~MoveElementsCommand() override;
|
||||
private:
|
||||
MoveElementsCommand(const MoveElementsCommand &);
|
||||
|
||||
// methods
|
||||
public:
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
virtual void move(const QPointF &);
|
||||
|
||||
private:
|
||||
void setupAnimation (QObject * target,
|
||||
const QByteArray &propertyName,
|
||||
const QVariant& start,
|
||||
const QVariant& end);
|
||||
|
||||
// attributes
|
||||
private:
|
||||
/// diagram the movement takes place on.
|
||||
Diagram *diagram;
|
||||
/// moved content
|
||||
DiagramContent content_to_move;
|
||||
/// applied movement
|
||||
QPointF movement;
|
||||
///animation group
|
||||
QParallelAnimationGroup *m_anim_group;
|
||||
/// prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
@brief The MoveConductorsTextsCommand class
|
||||
This command moves text items related to conductors
|
||||
|
||||
Reference in New Issue
Block a user