From d87ebea3be105e8e5f46e096af5109b9d2eb7e0a Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 24 Sep 2018 14:47:24 +0200 Subject: 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 --- src/charts/linechart/linechartitem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3