[Development] Changing qreal to a float

lars.knoll at nokia.com lars.knoll at nokia.com
Wed Feb 15 10:58:05 CET 2012

On 2/15/12 10:28 AM, "ext Thiago Macieira" <thiago.macieira at intel.com>

>On quarta-feira, 15 de fevereiro de 2012 08.49.31, lars.knoll at nokia.com
>> I don't think it'll break too many places though, so I'm not too worried
>> about the change.
>It will. Ask Ubuntu packagers for how much work they had to put in to fix
>mismatches in KDE. We can assume that work is done, but other Qt-based
>software, including non-OSS software, will probably have similar issues.
>it should be noted that they had lots of rework because the software kept
>breaking. If this change is made to all, one can assume that it will not
>on breaking".
>This change by itself isn't that big. Whenever you see a template error
>no overloads for floats and doubles, you know what it is. The problem is
>this error adds up to the porting needs for software to get from Qt 4 to
>Qt 5 
>and this is likely to be widespread. It will appear on the first
>and you have to fix them immediately, including changing certain data
>structures, in order to continue the porting.

Yes, some template code will break.
>> Choosing float has my vote, as it'll use a lot less memory and is the
>> right thing in the common case. It also directly maps to OpenGL types.
>> Let's rather use double explicitly where needed.
>I'm not disagreeing. I'm just giving more information for the
>I completely agree we should choose one or the other, not change
>according to 
>platform. Accordingly, QT_COORD_TYPE should be removed to.

>Which one to choose, I haven't made up my mind.

We will in any case break either code written for x86 or code written for

Given that using  float everywhere makes most of our data structures
smaller, matches with OpenGL, as well as significantly improves
performance on many systems makes me believe we should go for float.


More information about the Development mailing list