qlocale

Qt Why use QString::number() over QLocale().toString()?

∥☆過路亽.° 提交于 2019-12-23 01:26:31
问题 The application I am working on will be launched in many countries and needs to support their language. I've been going back through my code and replacing every instance of: QString::number() and QString().toDouble() with QLocale().toString() and QLocale().toDouble() I haven't found much online comparing the two classes, but I am interested in the repercussions of using the latter, and if there are none - why ever use the QString functions? Essentially I just want to make sure I'm not harming

QLocale and QSettings

╄→尐↘猪︶ㄣ 提交于 2019-12-08 03:56:28
问题 Premise: I'm on osx using qt5.7 I've changed the decimal separator in the System Preferences - Language and Region - Advanced to use the comma: I have a problem in storing/restoring the QLocale value via QSettings . This is the main.cpp : #include <QSettings> #include <QDebug> void printLocale(QString header, QLocale locale) { qDebug() << QLocale::languageToString(locale.language()) << QLocale::scriptToString(locale.script()) << QLocale::countryToString(locale.country()) << locale