CLineItem.h 845 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef CLINEITEM_H
  2. #define CLINEITEM_H
  3. #include "CPathItem.h"
  4. class CLineItem : public CPathItem
  5. {
  6. public:
  7. typedef enum
  8. {
  9. Curve,
  10. Line,
  11. Polyline,
  12. CurveToLine,
  13. } CLineType;
  14. explicit CLineItem(QGraphicsItem *parent = nullptr);
  15. explicit CLineItem(const QPointF &startPos, const QPointF &endPos, QGraphicsItem *parent = nullptr);
  16. QPointF startPos() const;
  17. void setStartPos(const QPointF start);
  18. QPointF endPos() const;
  19. void setEndPos(const QPointF end);
  20. CLineType lineType() const;
  21. void setLineType(CLineType type);
  22. bool showArrow() const;
  23. void setShowArrow(bool s);
  24. void updatePath() override;
  25. private:
  26. QPointF m_startPos;
  27. QPointF m_endPos;
  28. CLineType m_lineType = Curve;
  29. bool m_showArrow = false;
  30. };
  31. #endif // CLINEITEM_H