mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Dans l'editeur d'elements, les changements d'orientations sont desormais annulables
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@121 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -297,3 +297,38 @@ void ChangeNamesCommand::undo() {
|
||||
void ChangeNamesCommand::redo() {
|
||||
element -> setNames(names_after);
|
||||
}
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param element_scene Element edite
|
||||
@param before Orientations avant changement
|
||||
@param after Orientationss apres changement
|
||||
@param parent QUndoCommand parent
|
||||
*/
|
||||
ChangeOrientationsCommand::ChangeOrientationsCommand(
|
||||
ElementScene *element_scene,
|
||||
const OrientationSet &before,
|
||||
const OrientationSet &after,
|
||||
QUndoCommand *parent
|
||||
) :
|
||||
QUndoCommand(QObject::tr("modification orientations"), parent),
|
||||
ori_before(before),
|
||||
ori_after(after),
|
||||
element(element_scene)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ChangeOrientationsCommand::~ChangeOrientationsCommand() {
|
||||
}
|
||||
|
||||
/// Annule le changement
|
||||
void ChangeOrientationsCommand::undo() {
|
||||
element -> setOrientations(ori_before);
|
||||
}
|
||||
|
||||
/// Refait le changement
|
||||
void ChangeOrientationsCommand::redo() {
|
||||
element -> setOrientations(ori_after);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user