日志
-
2014-08-28 05:36
-
Qt5 C++源码中使用中文的简单步骤|
阅读全文»分类:默认分类|回复:0|浏览:1257
转自:http://www.qtcn.org/bbs/read-htm-tid-54663.html
本文不讲任何道理,当你在Qt5的C++源文件内使用中文时,你只需按顺序简单照做即可。(不止是中文,其实你完全可以在代码中使用日韩法俄语等等各国语言)
0. [通用] 源文件保存为带BOM的UTF-8格式
如果你准备跨平台,保存为带BOM的UTF-8是必不可少的。而后,源码中的所有字符串常量使用 QStringLiteral 宏进行包裹
复制代码
QString s1 = QStringLiteral("中国");edit.setText(QStringLiteral("中国"));
仅仅这样就可以了。
..
-
2012-10-20 10:19
-
The QModelIndex class is used to locate data in a data model.The index is used by item views, delegates, and selectionmodels to locate an item in the model.
阅读全文»分类:默认分类|回复:0|浏览:4184
Aselection model belonging to one view can be obtained using the view's selectionModel() function, and sharedbetween many views with setSelectionModel(),so the construction of new selection models is generally not required.
weconstruct an instance of a custom table model with 32 items in total, and opena table view onto its data. The tab ..