|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef DIAGRAM_COMMANDS_H
19 #define DIAGRAM_COMMANDS_H
41 template <
typename QGI>
45 const QPointF &pos = QPointF(),
46 QUndoCommand *parent =
nullptr) :
47 QUndoCommand (parent),
92 QUndoCommand * =
nullptr);
100 void redo()
override;
122 QUndoCommand * =
nullptr);
136 const QPointF &m, QUndoCommand * =
nullptr);
143 void undo()
override;
144 void redo()
override;
145 virtual void move(
const QPointF &);
149 const QByteArray &propertyName,
150 const QVariant& start,
151 const QVariant& end);
182 void undo()
override;
183 void redo()
override;
210 const QString &before,
211 const QString &after,
212 QUndoCommand * =
nullptr);
219 void undo()
override;
220 void redo()
override;
244 QUndoCommand * =
nullptr);
251 void undo()
override;
252 void redo()
override;
283 QUndoCommand * =
nullptr);
290 void undo()
override;
291 void redo()
override;
317 void undo()
override;
318 void redo()
override;
QPointF movement
applied movement
Definition: diagramcommands.h:160
void redo() override
ChangeDiagramTextCommand::redo.
Definition: diagramcommands.cpp:455
virtual void addTextMovement(ConductorTextItem *, const QPointF &, const QPointF &, bool=false)
MoveConductorsTextsCommand::addTextMovement Ajout un mouvement de champ de texte a cet objet.
Definition: diagramcommands.cpp:381
Diagram * m_diagram
Definition: diagramcommands.h:75
void setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant &start, const QVariant &end)
MoveElementsCommand::setupAnimation Set up the animation for this undo command.
Definition: diagramcommands.cpp:298
The BorderProperties class This class is a container for dimensions and display properties of a diagr...
Definition: borderproperties.h:29
bool first_redo
prevent the first call to redo()
Definition: diagramcommands.h:199
void undo() override
PasteDiagramCommand::undo Undo this command.
Definition: diagramcommands.cpp:75
@ Images
Definition: diagramcontent.h:57
@ ConductorsToMove
Definition: diagramcontent.h:58
Definition: conductorprofile.h:28
Diagram * diagram
diagram content is pasted onto
Definition: diagramcommands.h:107
Definition: qetgraphicsitem.h:27
ConductorProfile old_profile
profile before the change
Definition: diagramcommands.h:260
void regenerateTextLabel()
MoveConductorsTextsCommand::regenerateTextLabel Genere la description de l'objet d'annulation.
Definition: diagramcommands.cpp:400
QString itemText(const QetGraphicsItem *item)
Definition: diagramcommands.cpp:31
ResetConductorCommand(const QHash< Conductor *, ConductorProfilesGroup > &, QUndoCommand *=nullptr)
ResetConductorCommand::ResetConductorCommand.
Definition: diagramcommands.cpp:535
void undo() override
MoveElementsCommand::undo.
Definition: diagramcommands.cpp:220
ChangeConductorCommand(Conductor *, const ConductorProfile &, const ConductorProfile &, Qt::Corner, QUndoCommand *=nullptr)
ChangeConductorCommand::ChangeConductorCommand Constructeur.
Definition: diagramcommands.cpp:470
Diagram * diagram
Definition: diagramcommands.h:297
Diagram * diagram
modified diagram
Definition: diagramcommands.h:323
QList< Conductor * > m_conductors_to_move
Definition: diagramcontent.h:74
@ TextFields
Definition: diagramcontent.h:55
Definition: deleteqgraphicsitemcommand.h:31
QHash< ConductorTextItem *, QPair< QPointF, bool > > texts_to_move_
text items to be moved
Definition: diagramcommands.h:197
virtual void addItem(QGraphicsItem *item)
Diagram::addItem Réimplemented from QGraphicsScene::addItem(QGraphicsItem *item) Do some specific ope...
Definition: diagram.cpp:1550
ChangeDiagramTextCommand(DiagramTextItem *, const QString &before, const QString &after, QUndoCommand *=nullptr)
ChangeDiagramTextCommand::ChangeDiagramTextCommand Constructeur.
Definition: diagramcommands.cpp:421
Diagram * diagram
Definition: diagramcommands.h:232
Definition: diagramcontent.h:46
QGI m_item
Definition: diagramcommands.h:74
Diagram * diagram
diagram the movement takes place on.
Definition: diagramcommands.h:156
QList< Element * > m_elements
Definition: diagramcontent.h:69
virtual QString name() const
Definition: qetgraphicsitem.h:44
QList< Conductor * > m_conductors_to_update
Definition: diagramcontent.h:73
The ResetConductorCommand class This command resets conductor paths.
Definition: diagramcommands.h:278
bool first_redo
prevent the first call to redo()
Definition: diagramcommands.h:270
void redo() override
MoveConductorsTextsCommand::redo refait le deplacement.
Definition: diagramcommands.cpp:356
void setHtml(const QString &text)
Definition: diagramtextitem.cpp:212
PasteDiagramCommand(const PasteDiagramCommand &)
CutDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand *=nullptr)
CutDiagramCommand::CutDiagramCommand Constructeur.
Definition: diagramcommands.cpp:144
~ChangeDiagramTextCommand() override
ChangeDiagramTextCommand::~ChangeDiagramTextCommand destructeur.
Definition: diagramcommands.cpp:440
QParallelAnimationGroup * m_anim_group
animation group
Definition: diagramcommands.h:162
QString ElementsAndConductorsSentence(int elements=0, int conductors=0, int indi_texts=0, int images=0, int shapes=0, int element_text=0, int tables_count=0)
QET::ElementsAndConductorsSentence Permet de composer rapidement la proposition "x elements et y cond...
Definition: qet.cpp:258
@ ElementTextFields
Definition: diagramcontent.h:56
QString sentence(int=All) const
DiagramContent::sentence.
Definition: diagramcontent.cpp:438
Diagram * diagram
Definition: diagramcommands.h:271
void undo() override
ChangeConductorCommand::undo Annule la modification du conducteur.
Definition: diagramcommands.cpp:498
void redo() override
ChangeBorderCommand::redo Refait les changements apportes au schema.
Definition: diagramcommands.cpp:620
DiagramTextItem * text_item
modified text item
Definition: diagramcommands.h:225
QPointF text_pos_before_mov_
position of the text item before the change
Definition: diagramcommands.h:266
~PasteDiagramCommand() override
PasteDiagramCommand::~PasteDiagramCommand Destructor.
Definition: diagramcommands.cpp:67
void undo() override
Definition: diagramcommands.h:60
QString text_after
new text
Definition: diagramcommands.h:229
DiagramContent content_to_move
moved content
Definition: diagramcommands.h:158
Definition: diagramimageitem.h:31
Diagram * diagram
diagram the movement takes place on.
Definition: diagramcommands.h:195
QHash< Conductor *, ConductorProfilesGroup > conductors_profiles
impacted conductors along with their former profiles
Definition: diagramcommands.h:296
void redo() override
Definition: diagramcommands.h:66
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
QPointF text_pos_after_mov_
position of the text item after the change
Definition: diagramcommands.h:268
~ChangeBorderCommand() override
ChangeBorderCommand::~ChangeBorderCommand Destructeur.
Definition: diagramcommands.cpp:604
The ChangeConductorCommand class This command changes a particular conductor.
Definition: diagramcommands.h:239
~CutDiagramCommand() override
CutDiagramCommand::~CutDiagramCommand Destructeur.
Definition: diagramcommands.cpp:165
void undo() override
MoveConductorsTextsCommand::undo annule le deplacement.
Definition: diagramcommands.cpp:339
ChangeBorderCommand(const ChangeBorderCommand &)
int filter
filter stating what kinds of items should be pasted
Definition: diagramcommands.h:109
bool first_redo
prevent the first call to redo()
Definition: diagramcommands.h:231
virtual void removeItem(QGraphicsItem *item)
Diagram::removeItem Reimplemented from QGraphicsScene::removeItem(QGraphicsItem *item) Do some specif...
Definition: diagram.cpp:1581
bool first_redo
prevent the first call to redo()
Definition: diagramcommands.h:111
@ ConductorsToUpdate
Definition: diagramcontent.h:59
QHash< Qt::Corner, ConductorProfile > ConductorProfilesGroup
Definition: conductor.h:37
virtual void move(const QPointF &)
MoveElementsCommand::move Move item and conductor to actual_movement.
Definition: diagramcommands.cpp:248
The MoveConductorsTextsCommand class This command moves text items related to conductors on a particu...
Definition: diagramcommands.h:172
CutDiagramCommand(const CutDiagramCommand &)
BorderProperties old_properties
properties before the change
Definition: diagramcommands.h:326
The AddItemCommand class This command add an item in a diagram The item to add is template,...
Definition: diagramcommands.h:42
Qt::Corner path_type
Path type of the modified conductor.
Definition: diagramcommands.h:264
QPointF pos
Definition: conductor.h:46
DiagramContent content
pasted content
Definition: diagramcommands.h:105
~ResetConductorCommand() override
ResetConductorCommand::~ResetConductorCommand.
Definition: diagramcommands.cpp:554
~MoveElementsCommand() override
MoveElementsCommand::~MoveElementsCommand Destructor.
Definition: diagramcommands.cpp:213
QPointF m_pos
Definition: diagramcommands.h:76
ChangeDiagramTextCommand(const ChangeDiagramTextCommand &)
void redo() override
ResetConductorCommand::redo.
Definition: diagramcommands.cpp:570
AddItemCommand(QGI item, Diagram *diagram, const QPointF &pos=QPointF(), QUndoCommand *parent=nullptr)
Definition: diagramcommands.h:44
void undo() override
ResetConductorCommand::undo.
Definition: diagramcommands.cpp:560
The MoveElementsCommand class This command moves some content on a particular diagram.
Definition: diagramcommands.h:132
~AddItemCommand() override
Definition: diagramcommands.h:56
Definition: diagramtextitem.h:34
@ All
Definition: diagramcontent.h:65
bool first_redo
prevent the first call to redo()
Definition: diagramcommands.h:164
The ChangeDiagramTextCommand class This commad modifies a text item.
Definition: diagramcommands.h:206
MoveElementsCommand(Diagram *, const DiagramContent &, const QPointF &m, QUndoCommand *=nullptr)
MoveElementsCommand::MoveElementsCommand Constructor.
Definition: diagramcommands.cpp:176
void undo() override
ChangeDiagramTextCommand::undo annule la modification de texte.
Definition: diagramcommands.cpp:447
virtual void setConductorTextItemMove(const QPointF &, const QPointF &)
ChangeConductorCommand::setConductorTextItemMove Integre dans cet objet d'annulation le repositionnem...
Definition: diagramcommands.cpp:525
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition: elementtextitemgroup.h:36
void redo() override
PasteDiagramCommand::redo Redo this commnand.
Definition: diagramcommands.cpp:87
void redo() override
MoveElementsCommand::redo.
Definition: diagramcommands.cpp:230
MoveConductorsTextsCommand(Diagram *, QUndoCommand *=nullptr)
MoveConductorsTextsCommand::MoveConductorsTextsCommand Constructeur.
Definition: diagramcommands.cpp:318
ChangeBorderCommand(Diagram *, const BorderProperties &, const BorderProperties &, QUndoCommand *=nullptr)
ChangeBorderCommand::ChangeBorderCommand Constructeur.
Definition: diagramcommands.cpp:587
~MoveConductorsTextsCommand() override
MoveConductorsTextsCommand::~MoveConductorsTextsCommand Destructeur.
Definition: diagramcommands.cpp:332
void undo() override
ChangeBorderCommand::undo Annule les changements apportes au schema.
Definition: diagramcommands.cpp:611
PasteDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand *=nullptr)
PasteDiagramCommand::PasteDiagramCommand Constructor.
Definition: diagramcommands.cpp:52
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition: conductorproperties.h:68
Definition: independenttextitem.h:28
The CutDiagramCommand class This command cuts content from a particular diagram.
Definition: diagramcommands.h:118
@ Shapes
Definition: diagramcontent.h:62
void redo() override
ChangeConductorCommand::redo Refait la modification du conducteur.
Definition: diagramcommands.cpp:508
The PasteDiagramCommand class This command pastes some content onto a particular diagram.
Definition: diagramcommands.h:88
ConductorProfile new_profile
profile after the change
Definition: diagramcommands.h:262
QList< QGraphicsItem * > items(int=All) const
DiagramContent::items.
Definition: diagramcontent.cpp:374
MoveElementsCommand(const MoveElementsCommand &)
Conductor * conductor
changed conductor
Definition: diagramcommands.h:258
BorderProperties new_properties
properties after the change
Definition: diagramcommands.h:328
Definition: conductor.h:43
~ChangeConductorCommand() override
ChangeConductorCommand::~ChangeConductorCommand Destructeur.
Definition: diagramcommands.cpp:491
ResetConductorCommand(const ResetConductorCommand &)
QString text_before
former text
Definition: diagramcommands.h:227
Definition: conductortextitem.h:30
@ Elements
Definition: diagramcontent.h:54
QString text
Definition: conductorproperties.h:89
bool addValue(const QString &, const QVariant &, bool show=true)
Definition: diagramcontext.cpp:91
QString itemText(const QetGraphicsItem *item)
Definition: diagramcommands.cpp:31
QIcon tr
Definition: qeticons.cpp:206
ChangeConductorCommand(const ChangeConductorCommand &)
The ChangeBorderCommand class This command changes the border properties of a particular diagram.
Definition: diagramcommands.h:306
Definition: diagramcontext.h:56
MoveConductorsTextsCommand(const MoveConductorsTextsCommand &)