mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-03 19:10:53 +01:00
Toatly revamp of the handlers use to modify primitves, shapes and conductors.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5001 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -20,10 +20,9 @@
|
||||
|
||||
#include <QPolygonF>
|
||||
#include "customelementgraphicpart.h"
|
||||
#include "QetGraphicsItemModeler/qetgraphicshandlerutility.h"
|
||||
|
||||
|
||||
class QPropertyUndoCommand;
|
||||
class QetGraphicsHandlerItem;
|
||||
|
||||
/**
|
||||
* @brief The PartPolygon class
|
||||
@@ -85,17 +84,25 @@ class PartPolygon : public CustomElementGraphicPart
|
||||
void setClosed (bool close);
|
||||
|
||||
protected:
|
||||
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
|
||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
|
||||
|
||||
private:
|
||||
void adjusteHandlerPos();
|
||||
void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
void sceneSelectionChanged ();
|
||||
|
||||
void addHandler();
|
||||
void removeHandler();
|
||||
|
||||
|
||||
bool m_closed;
|
||||
QList<QPointF> saved_points_;
|
||||
QPolygonF m_polygon;
|
||||
QetGraphicsHandlerUtility m_handler;
|
||||
int m_handler_index;
|
||||
QPropertyUndoCommand *m_undo_command;
|
||||
int m_vector_index = -1;
|
||||
QVector<QetGraphicsHandlerItem *> m_handler_vector;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user