#include "CPathItem.h" #include #include CPathItem::CPathItem(QGraphicsItem *parent) : QGraphicsPathItem(parent) { applySettings(); } int CPathItem::lineWidth() const { return m_lineWidth; } void CPathItem::setLineWidth(int w) { m_lineWidth = w; applySettings(); } QColor CPathItem::normaLineColor() const { return m_normalLineColor; } void CPathItem::setNormalLineColor(QColor c) { m_normalLineColor = c; applySettings(); } QColor CPathItem::highlightLineColor() const { return m_highlightLineColor; } void CPathItem::setHighlightLineColor(QColor c) { m_highlightLineColor = c; applySettings(); } QColor CPathItem::normalFillColor() const { return m_normalFillColor; } void CPathItem::setNormalFillColor(QColor c) { m_normalFillColor = c; applySettings(); } QColor CPathItem::highlightFillColor() const { return m_highlightFillColor; } void CPathItem::setHighlightFillColor(QColor c) { m_highlightFillColor = c; applySettings(); } bool CPathItem::highlighted() const { return m_highlighted; } void CPathItem::setHighlighted(bool h) { m_highlighted = h; applySettings(); } void CPathItem::applySettings() { QPen pen = this->pen(); pen.setWidth(m_lineWidth); pen.setColor(m_highlighted ? m_highlightLineColor : m_normalLineColor); setPen(pen); setBrush(m_highlighted ? m_highlightFillColor : m_normalFillColor); }