@@ -123,15 +123,23 void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt | |||
|
123 | 123 | |
|
124 | 124 | painter->save(); |
|
125 | 125 | painter->setPen(m_linePen); |
|
126 | painter->setBrush(m_linePen.color()); | |
|
127 | 126 | painter->setClipRect(QRectF(QPointF(0,0),domain()->size())); |
|
128 | 127 | |
|
129 | 128 | if (m_pointsVisible) { |
|
129 | painter->setBrush(m_linePen.color()); | |
|
130 | 130 | painter->drawPath(m_linePath); |
|
131 | 131 | } else { |
|
132 | for (int i(1); i < m_points.size(); i++) | |
|
133 | painter->drawLine(m_points.at(i - 1), m_points.at(i)); | |
|
132 | painter->setBrush(QBrush(Qt::NoBrush)); | |
|
133 | if (m_linePen.style() != Qt::SolidLine) { | |
|
134 | // If pen style is not solid line, always fall back to path painting | |
|
135 | // to ensure proper continuity of the pattern | |
|
136 | painter->drawPath(m_linePath); | |
|
137 | } else { | |
|
138 | for (int i(1); i < m_points.size(); i++) | |
|
139 | painter->drawLine(m_points.at(i - 1), m_points.at(i)); | |
|
140 | } | |
|
134 | 141 | } |
|
142 | ||
|
135 | 143 | painter->restore(); |
|
136 | 144 | } |
|
137 | 145 |
General Comments 0
You need to be logged in to leave comments.
Login now