12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef CPATHITEM_H
- #define CPATHITEM_H
- #include <QGraphicsPathItem>
- 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
|