mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-28 14:50:52 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user