PDA

View Full Version : setLocale has no effect on Date



johannes.b
27th July 2011, 16:49
Hi!

I have a problem setting English locale settings on a computer running with a German Windows 7. I'm trying to locale my app with English (US), because I want to have the days of the week printed in English.
My code looks like this:



QLocale lc=QLocale(QLocale::English,QLocale::UnitedStates) ;
QLocale::setDefault(lc);

QDate d=QDate::currentDate();
QString str=d.toString("dddd");

std::cout << str.toStdString() << std::endl;


(This is done at the very beginning of the program in main.cpp. All other widgets are loaded afterwards.)

It still prints out the name of the day in German. What am I doing wrong?
How can I print the days of the week in English?

Greets
Johannes