Element editor : add handler for modifie primitives

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4058 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-07-20 17:45:37 +00:00
parent effa4e9997
commit c885ce3d7a
18 changed files with 543 additions and 42 deletions

View File

@@ -20,6 +20,10 @@
#include <QPolygonF>
#include "customelementgraphicpart.h"
#include "QetGraphicsItemModeler/qetgraphicshandlerutility.h"
class ChangePartCommand;
/**
* @brief The PartPolygon class
@@ -31,6 +35,7 @@ class PartPolygon : public CustomElementGraphicPart
Q_OBJECT
Q_PROPERTY(bool closed READ isClosed WRITE setClosed)
Q_PROPERTY(QPolygonF polygon READ polygon WRITE setPolygon)
// constructors, destructor
public:
@@ -73,10 +78,18 @@ class PartPolygon : public CustomElementGraphicPart
bool isClosed () const {return m_closed;}
void setClosed (bool c) {m_closed = c;}
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
bool m_closed;
QList<QPointF> saved_points_;
QPolygonF m_polygon;
QetGraphicsHandlerUtility m_handler;
int m_handler_index;
ChangePartCommand *m_undo_command;
};
#endif