2012/2/21 <[email protected]>

> return QString::asprintf("%d bytes", int(number));
> should be:
> return tr("%n bytes", 0, number);
>
> Same here:
> const QString num = QString::asprintf("%.1f KB/s", bytesPerSecond /
> 1024.0);
> should be:
> const QString num = tr("%1 KB/s").arg(bytesPerSecond/1024.0, 0, 'f', 1);
>
> ...And the list goes on (I stopped at qmap.cpp)
>

I don't know if this is really the right comparison, both are slower and
harder to understand.

sprintf() is great for formatted output, much better than chaining .args().
It also has the potential for being a lot faster.

It sounds like a step in the wrong direction to remove QString::sprintf()
and friends without adding something better.

The purpose of the function is, after all, to allow construction of
formatted output without concatenating substrings.

-- 
Andreas Aardal Hanssen
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to