目的

QLocale:地方

QLocale is initialized with a language/country pair in its constructor and offers number-to-string and string-to-number conversion functions similar to those in QString.

因此本质来说: 它是一个<语言、国家> pair.

QLocale supports the concept of a default locale, which is determined from the system's locale settings at application startup. The default locale can be changed by calling the static member setDefault(). Setting the default locale has the following effects:If a QLocale object is constructed with the default constructor, it will use the default locale's settings.QString::toInt(), QString::toDouble(), etc., interpret the string according to the default locale. If this fails, it falls back on the "C" locale.QString::arg() uses the default locale to format a number when its position specifier in the format string contains an 'L', e.g. "%L1".

在应用程序启动时,QLocale 支持由系统本地配置中决定的default locale;

当前< language/country >pair 有构造函数确定后, 可能会有如下三种情况发生。

When a language/country pair is specified in the constructor, one of three things can happen:If the language/country pair is found in the database, it is used.If the language is found but the country is not, or if the country is AnyCountry, the language is used with the most appropriate available country (for example, Germany for German),If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault()).
Use language() and country() to determine the actual language and country values used.
Note: For the current keyboard input locale take a look at QInputMethod::locale().
获取输入法本地的locale

最终

最终获取的是数据来源于windows 区域格式设置。如下图所示:

Qt::QLocale相关推荐

  1. QT的QLocale类的使用

    详细说明 QLocale类在数字及其各种语言的字符串表示形式之间进行转换. QLocale在其构造函数中使用语言/国家/地区对进行了初始化,并提供与QString类似的数字到字符串和字符串到数字转换功 ...

  2. Qt动态多语言的实现(VS2012开发)

    Qt对于多语言提供了QTranslator的接口,只要在程序启动时进行安装,然后动态改变QTranslator的加载即可.下面是效果图(英文/简体/繁体). 选择不同的语言,界面会随着切换.这要如何实 ...

  3. Qt中的QLineEdit、QTextEdit、QPlainTextEdit

    文章目录 1 Qt中的文本编辑组件 2 QLineEdit组件 2.1 QLineEdit组件简介 2.2 QLineEdit常用方法 1 Qt中的文本编辑组件 Qt中支持3种常用的文本编辑组件: Q ...

  4. Qt学习笔记之国际化

    国际化的英文表述为Internationalization,通常简写为I18N(首尾字母加中间的字符数),一个应用程序的国际化就是使该应用程序可以让其他国家的用户使用的过程. 1. 相关的Qt类和AP ...

  5. Qt学习笔记之QTranslator

    QTranslator类为文本输出提供国际化支持. 此类的一个对象包含一组从源语言到目标语言的转换.QTranslator提供了在翻译文件中查找翻译的功能.翻译文件是使用Qt Linguist创建的. ...

  6. qt带小数点的数字串显示,Qt-自定义小数点和千位分隔符

    How can I convert a number (double) to string, with custom decimal point and thousand separator char ...

  7. QT:基本知识(一);

    注: 该博文为扩展型: 1)   QString转换为LPCTSTR QString   szStr; LPCTSTR  str =  (LPWSTR)(szStr.utf16()); 2)   中文 ...

  8. qt c++ 图片预览_Qt多语言国际化

    Qt附加工具介绍 Qt Assistant(Qt助手) Qt Linguist(Qt语言家) Qt Designer(Qt设计师) Qt Assistant Qt Assistant是可配置且可重新发 ...

  9. Qt文档阅读笔记-隐式共享(Implicit Sharing)深入研究(理论及实例)

    Qt里面很多C++类都是采用隐式共享最大限度的提高资源利用率以及最新复制的原则.隐式共享数据作为参数时,不仅安全而且高效,因为传的是一个指针并且只有要修改这个数据时才会去拷贝,这里有个专业词汇copy ...

最新文章

  1. C++从键盘输入二维数组
  2. Windows Server 2003 R2 修复Windows Server 2003
  3. 快消行业指的是哪些?
  4. oracle 文件写 n r,文本模式读写文件中\r和\n的问题
  5. sql分类及基本sql操作,校对规则(mysql学习笔记二)
  6. MySQL视图、事务与存储过程
  7. Qt简单的解析Json数据例子(一)
  8. 深入Java中文问题及最优解决方法--上(转)
  9. redis的简易安装
  10. jQuery再学习之二、jQuery选择器
  11. 1438. 绝对差不超过限制的最长连续子数组
  12. Django 中related_name,%(app_label)s_%(class)s_related
  13. ActiveMQ 简介、安装、与 Maven 项目基本使用
  14. 视频教程-带你轻松入门MATLAB-Matlab
  15. python中pop类型_Python基础之基本数据类型
  16. python代码 练习3:空气质量查询工具
  17. leetcode刷题之 剑指offe 面试题05. 替换空格 犯傻记录
  18. 图像处理学习笔记2.0
  19. python计算等额本金_等额本金-逆推 - tedzheng的个人空间 - OSCHINA - 中文开源技术交流社区...
  20. Centos7.6离线安装显卡驱动

热门文章

  1. ubuntu下定时清理文件
  2. 【算法练习】CodeVs1391 伊吹萃香(分层图最短路)
  3. 云服务厂商人才空心化隐忧
  4. ng-template、ng-content、ng-container
  5. 关于系统架构你不知道的那些事-架构设计流程:评估和选择备选方案
  6. 移动互联网时代的失意者
  7. 前端学习-数据可视化(个人笔记)
  8. (转载)多少年来心血的结晶
  9. 浅聊一下Java中的char类型
  10. Python安装和导入cv库