Les editions de champs (conducteurs et elements) sont desormais annulables

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@138 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet
2007-09-26 22:57:53 +00:00
parent 5150cb38ad
commit bc650ea347
9 changed files with 183 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
#ifndef DIAGRAM_COMMANDS_H
#define DIAGRAM_COMMANDS_H
#include "diagram.h"
#include "diagramtextitem.h"
#include <QtGui>
/**
Cette classe represente l'action d'ajouter un element au schema
@@ -153,4 +154,33 @@ class MoveElementsCommand : public QUndoCommand {
/// booleen pour ne pas executer le premier redo()
bool first_redo;
};
/**
Cette classe represente la modification d'un champ de texte
*/
class ChangeDiagramTextCommand : public QUndoCommand {
// constructeurs, destructeur
public:
ChangeDiagramTextCommand(DiagramTextItem *, const QString &before, const QString &after, QUndoCommand * = 0);
virtual ~ChangeDiagramTextCommand();
private:
ChangeDiagramTextCommand(const ChangeDiagramTextCommand &);
// methodes
public:
virtual void undo();
virtual void redo();
// attributs
private:
/// DiagramTextItem modifie
DiagramTextItem *text_item;
/// texte avant changement
QString text_before;
/// texte apres changement
QString text_after;
/// booleen pour ne pas executer le premier redo()
bool first_redo;
};
#endif