#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; virtual 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; virtual void setHighlighted(bool h); virtual void updatePath() = 0; private: void applySettings(); protected: int m_lineWidth = 1; QColor m_normalLineColor = Qt::gray; QColor m_highlightLineColor = QColor("#33cccccc"); QColor m_normalFillColor = Qt::white; QColor m_highlightFillColor = QColor("#33cccccc"); bool m_highlighted = false; }; #endif // CPATHITEM_H