#ifndef CPATHITEM_H #define CPATHITEM_H #include class CPathItem : public QGraphicsPathItem { public: CPathItem(QGraphicsItem *parent = nullptr); int lineWidth() const; void setLineWidth(int w); QColor normaLineColor() const; void setNormalLineColor(QColor c); QColor highlightLineColor() const; void setHighlightLineColor(QColor c); QColor normalFillColor() const; void setNormalFillColor(QColor c); QColor highlightFillColor() const; void setHighlightFillColor(QColor c); bool highlighted() const; void setHighlighted(bool h); virtual void updatePath() = 0; private: void useCustomSettings(); private: int m_lineWidth = 2; QColor m_normalLineColor = Qt::gray; QColor m_highlightLineColor = Qt::blue; QColor m_normalFillColor = Qt::white; QColor m_highlightFillColor = Qt::lightGray; bool m_highlighted = false; }; #endif // CPATHITEM_H