[Development] FP calculations and stability in Qt

Konstantin Shegunov kshegunov at gmail.com
Sun May 12 21:46:39 CEST 2019


Thanks for chiming in, I do appreciate the thoughts.

On Sun, May 12, 2019 at 1:49 PM Christian Gagneraud <chgans at gmail.com>
wrote:

> I use to think that Qt could do a better job about FP
> precision/stability, but i had to realise that i was using Qt in a way
> that it was not designed for.
> For example, I tried to use QPainterPath, QLineF, QRectF, ... to do
> geometry processing. And i can tell you that QPainterPath is all but
> stable when it comes to small values. Highly zoomed-in QGraphicsView
> based geometry object yields crazy artifacts.
>

Doesn't this imply it should be dropped as an API that we can rely on?


> I then turned on specialised library, Qt is a GUI toolkit, and is
> optimised for painting. Qt takes all opportunities to be fast and
> efficient in that context, and that includes being "mathematically"
> imprecised, painting is all about pixels at the end of the day.
>

True, arriving at those pixels is the problem, at least as far as I can
tell.

Who cares where exactly a line intersect a polygon, if all you need to
> know is if you need to paint a pixel black or red.
>

Intersecting at the wrong point, means you paint the wrong pixel, right?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190512/a31349f1/attachment.html>


More information about the Development mailing list