PDA

View Full Version : QPainter clipping with precision behind the decimal point



Pieter from Belgium
14th March 2007, 13:30
Hi,

In the context of a viewer for a heterogeneous set of geographical images, I need rendering with floating point precision. This works well, as long as I do not try to apply QRectF clips to the painter. When I do use rectangular clips, with behind the decimal point precision, the clips get rounded when I zoom in. At some sides, the clipping is done correctly (showing for instance halve pixels), at other sides the QRectF seems to be rounded to the nearest integer.

This problem strikes me, as otherwise, when zooming in to subpixel level (showing image pixels as large squares), the pixels of different images are correctly aligned, even if these images have a non-trivial spatial relationship (e.g. one is slightly tilted and has a non-integer offset w.r.t. the other). [good job of TrollTech I believe :D ]

Is there anything I can try to solve this? [Currently using Qt 4.2.3/X11]

Thanks,
Pieter

[Please do not ask me for a piece of code ;) this is not easy to isolate...]