summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2018-09-24 14:47:24 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2018-09-24 12:57:03 +0000
commitd87ebea3be105e8e5f46e096af5109b9d2eb7e0a (patch)
treea22df4ec420aa4e08840ad05576141d92bb2f312
parente049e83e795ab585c841ab7d710954c791f58ce0 (diff)
Fix rendering lines with Antialiasing render hint
When rendering with QPainter::Antialiasing set, lines need to be drawn in one set. Otherwise, each line is rendered with the anti-aliasing applied, causing the overlap to create a stronger area, which almost looks like a point from the point series. As a consequence, prefer drawPath() in that case. Task-number: QTBUG-61782 Change-Id: Ib2b44475e2e9ca0c28da7e898744bd72b992f5fd Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/charts/linechart/linechartitem.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/charts/linechart/linechartitem.cpp b/src/charts/linechart/linechartitem.cpp
index f41e5bc2..f31c69b4 100644
--- a/src/charts/linechart/linechartitem.cpp
+++ b/src/charts/linechart/linechartitem.cpp
@@ -406,7 +406,9 @@ void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
painter->drawPath(m_linePath);
} else {
painter->setBrush(QBrush(Qt::NoBrush));
- if (m_linePen.style() != Qt::SolidLine || alwaysUsePath) {
+ if (m_linePen.style() != Qt::SolidLine
+ || painter->renderHints().testFlag(QPainter::Antialiasing)
+ || alwaysUsePath) {
// If pen style is not solid line, always fall back to path painting
// to ensure proper continuity of the pattern
painter->drawPath(m_linePath);