mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-21 12:49:59 +02:00
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5420 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
class QDomElement;
|
||||
class QDomDocument;
|
||||
class QetGraphicsHandlerItem;
|
||||
class QAction;
|
||||
|
||||
/**
|
||||
* @brief The QetShapeItem class
|
||||
@@ -83,7 +84,7 @@ class QetShapeItem : public QetGraphicsItem
|
||||
bool setRect (const QRectF &rect);
|
||||
QPolygonF polygon() const {return m_polygon;}
|
||||
bool setPolygon (const QPolygonF &polygon);
|
||||
bool isClosed() const {return m_close;}
|
||||
bool isClosed() const {return m_closed;}
|
||||
void setClosed (bool close);
|
||||
|
||||
//Methods available for polygon shape
|
||||
@@ -101,10 +102,14 @@ class QetShapeItem : public QetGraphicsItem
|
||||
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override;
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
|
||||
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override;
|
||||
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
|
||||
|
||||
private:
|
||||
void switchResizeMode();
|
||||
void addHandler();
|
||||
void adjusteHandlerPos();
|
||||
void insertPoint();
|
||||
void removePoint();
|
||||
|
||||
void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event);
|
||||
@@ -115,12 +120,18 @@ class QetShapeItem : public QetGraphicsItem
|
||||
ShapeType m_shapeType;
|
||||
QPen m_pen;
|
||||
QBrush m_brush;
|
||||
QPointF m_P1, m_P2, m_old_P1, m_old_P2;
|
||||
QPointF m_P1,
|
||||
m_P2,
|
||||
m_old_P1,
|
||||
m_old_P2,
|
||||
m_context_menu_pos;
|
||||
QPolygonF m_polygon, m_old_polygon;
|
||||
bool m_hovered;
|
||||
int m_vector_index;
|
||||
bool m_close = false;
|
||||
bool m_closed = false;
|
||||
int m_resize_mode = 1;
|
||||
QVector<QetGraphicsHandlerItem *> m_handler_vector;
|
||||
QAction *m_insert_point,
|
||||
*m_remove_point;
|
||||
};
|
||||
#endif // QETSHAPEITEM_H
|
||||
|
||||
Reference in New Issue
Block a user