[Qt-interest] [BUG?]QLocale::to* functions and trailing whitespace
Mihail Naydenov
mlists at ymail.com
Tue Mar 24 18:52:42 CET 2009
The documentation states that all QLocale::to* functions (these are QLocale::toShort, QLocale::toLongLong, etc)
"ignores leading and trailing whitespace."
It turned out however that 'C' locale ( QLocale cl(QLocale::C); ) does leave trailing withespace!
It handles all other - leading, and in-between spaces, but leaves trialing.
Using the default local on my machine works fine and leaves no witespace.
Also using QString::to* functions acts as local 'C' leaving only tailing.
I have two questions:
Is this intended or a bug?
What is The Right Way to convert strings to numbers - using string::to* or with local()->to*?
Looking in the code, String calls QLocale in the end, so is there a difference?
Thank You
MihailNaydenov
PS Is there a chance the task tracker to be opened soon :) I have quite a few bugs to report, especially on Qt Creator.
And "interests" is obviously not the place...
More information about the Qt-interest-old
mailing list