|
@@ -0,0 +1,48 @@
|
|
|
+#include "CPathItem.h"
|
|
|
+
|
|
|
+#include <QPen>
|
|
|
+
|
|
|
+CPathItem::CPathItem(QGraphicsItem *parent) : QGraphicsPathItem(parent) { }
|
|
|
+
|
|
|
+int CPathItem::lineWidth() const
|
|
|
+{
|
|
|
+ QPen pen = this->pen();
|
|
|
+ return pen.width();
|
|
|
+}
|
|
|
+
|
|
|
+void CPathItem::setLineWidth(int width)
|
|
|
+{
|
|
|
+ QPen pen = this->pen();
|
|
|
+ pen.setWidth(width);
|
|
|
+ setPen(pen);
|
|
|
+}
|
|
|
+
|
|
|
+QColor CPathItem::lineColor() const
|
|
|
+{
|
|
|
+ QPen pen = this->pen();
|
|
|
+ return pen.color();
|
|
|
+}
|
|
|
+
|
|
|
+void CPathItem::setLineColor(QColor color)
|
|
|
+{
|
|
|
+ QPen pen = this->pen();
|
|
|
+ pen.setColor(color);
|
|
|
+ setPen(pen);
|
|
|
+}
|
|
|
+
|
|
|
+QColor CPathItem::fillColor() const
|
|
|
+{
|
|
|
+ QBrush brush = this->brush();
|
|
|
+ return brush.color();
|
|
|
+}
|
|
|
+
|
|
|
+void CPathItem::setFillColor(QColor color)
|
|
|
+{
|
|
|
+ setBrush(color);
|
|
|
+}
|
|
|
+
|
|
|
+void CPathItem::setHighlighted(bool highlighted)
|
|
|
+{
|
|
|
+ setLineColor(highlighted ? Qt::blue : Qt::transparent);
|
|
|
+ setFillColor(highlighted ? Qt::gray : Qt::white);
|
|
|
+}
|