[Interest] How to paint smooth rendering of connected QLineF's?
Francis Herne
mail at flherne.uk
Tue Feb 21 13:53:49 CET 2017
On Tue, 21 Feb 2017 02:17:24 -0800
Patrick Stinson <patrickkidd at gmail.com> wrote:
> Hello!
> I am painting a series of connected QLineF's with varying vectors and
> widths. Is there any way to smooth them out to be more vector-ish, so
> you don't see the jagged transitions between the segments?
>
> This is for hand writing notes with the Apple Pencil. I have one
> segment per event with pressure determining width and it just looks
> so jagged now...
>
> Thanks!
QSplineSeries from Qt Charts (http://doc.qt.io/qt-5/qsplineseries.html)
solves the same problem, but unfortunately it doesn't seem to be very
generalised.
Perhaps you could take the relevant parts of its implementation, which
seem to be calculateControlPoints(), updateGeometry() and paint() in
http://code.qt.io/cgit/qt/qtcharts.git/tree/src/charts/splinechart/splinechartitem.cpp
-Francis
More information about the Interest
mailing list