mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
polygon editor : use QPropertyUndoCommand instead of ChangePartCommand
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4069 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -360,40 +360,6 @@ void ChangePartCommand::redo()
|
||||
ElementEditionCommand::redo();
|
||||
}
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param p Polygone edite
|
||||
@param o_points points avant le changement
|
||||
@param n_points points apres le changement
|
||||
@param parent QUndoCommand parent
|
||||
*/
|
||||
ChangePolygonPointsCommand::ChangePolygonPointsCommand(
|
||||
PartPolygon *p,
|
||||
const QVector<QPointF> &o_points,
|
||||
const QVector<QPointF> &n_points,
|
||||
QUndoCommand *parent
|
||||
) :
|
||||
ElementEditionCommand(QObject::tr("modification points polygone", "undo caption"), 0, 0, parent),
|
||||
polygon(p),
|
||||
old_points(o_points),
|
||||
new_points(n_points)
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
ChangePolygonPointsCommand::~ChangePolygonPointsCommand() {
|
||||
}
|
||||
|
||||
/// Annule le changement
|
||||
void ChangePolygonPointsCommand::undo() {
|
||||
polygon -> setPolygon(old_points);
|
||||
}
|
||||
|
||||
/// Refait le changement
|
||||
void ChangePolygonPointsCommand::redo() {
|
||||
polygon -> setPolygon(new_points);
|
||||
}
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param element_scene Element edite
|
||||
|
||||
Reference in New Issue
Block a user