From 90a4c69b2520bfa30364828bda2498e08004c00f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 20 Oct 2014 13:35:16 +0200 Subject: [PATCH] Produce more correct clip path for QGraphicsShapeItem If no pen is set on the item, we can completely ignore the pen for the creation of the items shape. This both speeds up the creation of the shape and applying it as a clip mask as well as creating more correct results. Task-number: QTBUG-32846 Change-Id: I5f6f690256c71309713d8f746e67599af3088dd7 Reviewed-by: Laszlo Agocs --- src/widgets/graphicsview/qgraphicsitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 114c45dc0f..67d135271c 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -797,7 +797,7 @@ static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, cons // if we pass a value of 0.0 to QPainterPathStroker::setWidth() const qreal penWidthZero = qreal(0.00000001); - if (path == QPainterPath()) + if (path == QPainterPath() || pen == Qt::NoPen) return path; QPainterPathStroker ps; ps.setCapStyle(pen.capStyle());