diff options
authorAllan Sandfeld Jensen <>2014-03-28 12:56:39 +0100
committerThe Qt Project <>2014-03-29 10:39:11 +0100
commitf2e6570e4f31cbf565aa2849ccc12692c6201bd5 (patch)
parent8cde2faebccbea15c7e0c4df31402e6d3ce6a23f (diff)
Fix drawing paths with constant opacity onto PDF
The native PDF strokes can not be used with constant opacity as any overlapping parts of the path will end up being drawn multiple times getting the wrong final opacity. A constant opacity should therefore be treated the same as opacity on the pen color, and trigger the fallback drawing. Task-number: QTBUG-37101 Change-Id: I44f70a8b494567ee89804a5fa6333304a5abe91e Reviewed-by: Michael Bruning <> Reviewed-by: Gunnar Sletta <>
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 56cfc0f707..bda5df3d13 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1059,7 +1059,7 @@ void QPdfEngine::drawPath (const QPainterPath &p)
if (!d->hasPen && !d->hasBrush)
- if (d->simplePen) {
+ if (d->simplePen && d->opacity == 1.0) {
// draw strokes natively in this case for better output
*d->currentPage << QPdf::generatePath(p, QTransform(), d->hasBrush ? QPdf::FillAndStrokePath : QPdf::StrokePath);
} else {