[Development] Changing qreal to a float

Thiago Macieira thiago.macieira at intel.com
Mon Feb 20 14:36:31 CET 2012

On segunda-feira, 20 de fevereiro de 2012 09.33.27, andre.poenitz at nokia.com 
> This needlessly removes existing functionality. We promised to try
> hard to not do that in the Qt 4-> Qt 5 transition. Removing the typedef
> is essentially a showstopper for people currently relying on double.
> Leaving the 'qreal' typedef (to float...) hurts less as it can be fixed by
> recompilation,  and is not does not affect code size and performance
> compared to a global search&replace.

How about we leave it defined to double in all platforms and deprecate it?

$ gcc -xc++ -O3 -o /dev/null - <<EOF
__attribute__((deprecated)) typedef double qreal;                                                      
int main() { double x = 1.0; qreal y = x; return 0; }
<stdin>: In function ‘int main()’:
<stdin>:2:36: warning: ‘qreal’ is deprecated (declared at <stdin>:1) [-

And then proceed to use float where we need float?

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120220/c76dd2d7/attachment.sig>

More information about the Development mailing list