[Development] Changing qreal to a float

lars.knoll at nokia.com lars.knoll at nokia.com
Thu Feb 16 14:03:42 CET 2012


On 2/16/12 12:16 PM, "ext Giuseppe D'Angelo" <dangelog at gmail.com> wrote:

>On 15 February 2012 22:56, Sean Harmer <sh at theharmers.co.uk> wrote:
>> On 15/02/2012 11:53, andre.poenitz at nokia.com wrote:
>>> Anyway. It's probably better to go for any kind of uniformity. If
>>>that's single precision, it should be made clear  that QPolygonF/QRectF
>>>are not meant for applications needing "polygons" in general. Maybe one
>>>should consider adding some QPolygonD/QRectD/... later to get the
>>>functionality back. Until these exist, it might be worthwhile to keep
>>>the (then unconditional) typedef though, to allow easy creation of
>>>custom builds of Qt with double precision coordinates.
>>
>> Why not make these classes into templates and have typedefs for the
>> float and double cases? It always confused me why QVector<n>D mixed
>> qreals and floats.
>
>I agree, although typedefs will unfortunately break all forward
>declarations...

That would break quite a bit of code, so I'm against it.

It's not a big deal to simply add the QRectD, etc. types if required.

In any case, here's the patch to close the issue:
http://codereview.qt-project.org/16551

Cheers,
Lars




More information about the Development mailing list