mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 00:30:53 +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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user