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:
blacksun
2015-07-24 11:11:50 +00:00
parent 5b8a6a9745
commit b32e1bf339
6 changed files with 58 additions and 97 deletions

View File

@@ -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