1 // Thomas Nagy 2007-2021 GPLV3 2 3 #ifndef BOX_CTRL_H 4 #define BOX_CTRL_H 5 6 #include <QGraphicsRectItem> 7 #include <QBrush> 8 #include "CON.h" 9 #include "con.h" 10 11 class box_view; 12 class data_item; 13 class data_box; 14 class box_link; 15 class box_control_point : public QGraphicsRectItem 16 { 17 public: 18 box_control_point(box_view*); 19 bool m_bIsSegment; 20 bool m_bMoveX; 21 22 int m_iOffset; 23 box_link *m_oLink; 24 box_view *m_oView; 25 26 void init_pos(); 27 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *); 28 QPoint m_oRealPosition; 29 QVariant itemChange(GraphicsItemChange i_oChange, const QVariant &i_oValue); 30 31 void mousePressEvent(QGraphicsSceneMouseEvent* e); 32 void mouseReleaseEvent(QGraphicsSceneMouseEvent* e); 33 34 void force_position(const QPoint&); 35 int h_length(); 36 37 private: 38 bool m_bChanged; 39 bool m_bForced; 40 }; 41 42 #endif // BOX_CTRL_H 43 44