- 
    Bug 
- 
    Resolution: Done
- 
    P2: Important 
- 
    5.11.0
- 
    Linux/X11 OpenSuse
- 
        b72a9cbaaf7d49a1813c3b1926a68e05f47f350a
The PDF backend ignores the cosmetic attributes for certain pens.
The attribute indicating, if a pen is cosmetic or not gets stored in QPdf::Stroker ( see qpdf.cpp line 655 ). But later in QPdfEngine::drawPath the stroker is not used, when the pen is regarded as "simple".
According to qpdf.cpp line 1113 a pen is "simple", when the following conditions are met:
(penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque() && d->opacity == 1.0
According to the code it is possible to get the cosmetic attribute being respected by setting the penBrush to something non opaque. And indeed setting a pen color with an alpha value of 254 worked in our tests.
This bug also appears in earlier versions, maybe since the code was implemented.