Oh wow. Uwe, that's interesting.

We didn't intend to set a Qt::PenCapStyle on our QwtPlotCurves' pens. We do want our curves to be as precise as possible, and would want to stick with Qt::FlatCap. We aren't explicitly doing anything with cap style, but I am understanding that a defaulted constructed QPen -- or one constructed from a color or pen style (e.g. Dotted) -- has a cap style of Qt::SquareCap. (We must be assigning a QPen like that to our QwtPlotCurves, but I haven't found that in our code yet).

I DO see that when I force our QwtPlotCurves to have the Qt::FlatCap cap style -- see below -- the QwtLegend does show pen styles (e.g. Dotted) consistently with the plotted curve (with my modified code omitting the setting of the legend line's cap style -- see my prior post). So that explicit setting of Qt::FlatCap in QwtPlotCurve::legendIcon() I found seems to be unnecessary (at least now, in Qwt 6.1.3) [using Qt 5.5.1].

Qt Code:
  1. QPen curvePen = pen();
  2. curvePen.setCapStyle (Qt::FlatCap);
  3. setPen (curvePen);
To copy to clipboard, switch view to plain text mode