[Qt-interest] Convert a qreal to String

Srdjan Todorovic todorovic.s at googlemail.com
Thu Jun 18 11:26:40 CEST 2009


Hi,

On 18/06/2009, Jesús Fernández Prieto <jsfdez at gmail.com> wrote:
> *QString strNumber;
>
> #if defined(__arm__)
> strNumber=QString::number(float(real));
> #else
> strNumber=QString::number(double(real));
> #endif

Why the extra cast?
And why the Arm difference?

Wouldn't the compiler for the Arm architecture already typedef double
to a float if it can't handle a double? Or can you use both but a
float is faster for that architecture?

Srdjan




More information about the Qt-interest-old mailing list