@@ -82,10 +82,14 void LineChartItem::updateGeometry() | |||
|
82 | 82 | } |
|
83 | 83 | |
|
84 | 84 | m_linePath=linePath; |
|
85 | ||
|
85 | 86 | QPainterPathStroker stroker; |
|
87 | // QPainter::drawLine does not respect join styles, for example BevelJoin becomes MiterJoin. | |
|
88 | // This is why we are prepared for the "worst case" scenario, i.e. use always MiterJoin and | |
|
89 | // multiply line width with square root of two when defining shape and bounding rectangle. | |
|
86 | 90 | stroker.setWidth(m_linePen.width()*1.42); |
|
87 |
stroker.setJoinStyle( |
|
|
88 |
stroker.setCapStyle( |
|
|
91 | stroker.setJoinStyle(Qt::MiterJoin); | |
|
92 | stroker.setCapStyle(Qt::SquareCap); | |
|
89 | 93 | stroker.setMiterLimit(m_linePen.miterLimit()); |
|
90 | 94 | |
|
91 | 95 | prepareGeometryChange(); |
@@ -109,6 +113,7 void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt | |||
|
109 | 113 | Q_UNUSED(widget) |
|
110 | 114 | Q_UNUSED(option) |
|
111 | 115 | |
|
116 | ||
|
112 | 117 | painter->setPen(m_linePen); |
|
113 | 118 | |
|
114 | 119 | painter->setBrush(m_linePen.color()); |
General Comments 0
You need to be logged in to leave comments.
Login now