Gestion de la profondeur dans l'editeur d'element

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@165 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet
2007-10-07 18:52:01 +00:00
parent 07e7661cae
commit 438d169b36
15 changed files with 266 additions and 2 deletions

View File

@@ -225,4 +225,39 @@ class ChangeOrientationsCommand : public QUndoCommand {
/// Element edite auquel il faut appliquer les modifications
ElementScene *element;
};
/**
Cette classe represente l'action de changer les noms d'un element
*/
class ChangeZValueCommand : public QUndoCommand {
// constructeurs, destructeur
public:
enum Option { BringForward, Raise, Lower, SendBackward };
ChangeZValueCommand(ElementScene *, Option, QUndoCommand * = 0);
virtual ~ChangeZValueCommand();
private:
ChangeZValueCommand(const ChangeZValueCommand &);
// methodes
public:
virtual void undo();
virtual void redo();
private:
void applyBringForward(const QList<QGraphicsItem *> &);
void applyRaise(const QList<QGraphicsItem *> &);
void applyLower(const QList<QGraphicsItem *> &);
void applySendBackward(const QList<QGraphicsItem *> &);
// attributs
private:
/// zValues avant changement
QHash<QGraphicsItem *, qreal> undo_hash;
/// zValues apres changement
QHash<QGraphicsItem *, qreal> redo_hash;
/// Element edite auquel il faut appliquer les modifications
ElementScene *element;
/// type de traitement
Option option;
};
#endif