Use a better method for getting locale with Qt. Now works with Qt 4.7.