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

@@ -18,12 +18,10 @@
#ifndef EDITOR_COMMANDS_H
#define EDITOR_COMMANDS_H
#include "customelementpart.h"
#include "partpolygon.h"
#include "elementview.h"
#include "elementscene.h"
#include "elementcontent.h"
#include "qgimanager.h"
#include <QtWidgets>
/**
* @brief The ElementEditionCommand class
@@ -201,32 +199,6 @@ class ChangePartCommand : public ElementEditionCommand
QVariant m_new_value;
};
/**
This command changes the points of a polygon when editing an electrical
element.
*/
class ChangePolygonPointsCommand : public ElementEditionCommand {
// constructors, destructor
public:
ChangePolygonPointsCommand(PartPolygon *, const QVector<QPointF> &, const QVector<QPointF> &, QUndoCommand * = 0);
virtual ~ChangePolygonPointsCommand();
private:
ChangePolygonPointsCommand(const ChangePolygonPointsCommand &);
// methods
public:
virtual void undo();
virtual void redo();
// attributes
/// Changed polygon
PartPolygon *polygon;
/// Former points
QVector<QPointF> old_points;
/// New points
QVector<QPointF> new_points;
};
/**
This command changes the translated names of an electrical element.
*/