CLineItem.h 608 B

12345678910111213141516171819202122232425262728293031323334
  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. CLineType lineType() const;
  17. void setLineType(CLineType type);
  18. void updatePath() override;
  19. private:
  20. QPointF m_startPos;
  21. QPointF m_endPos;
  22. CLineType m_lineType = Curve;
  23. };
  24. #endif // CLINEITEM_H