Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2646864
  • 博文数量: 416
  • 博客积分: 10220
  • 博客等级: 上将
  • 技术积分: 4193
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-15 09:47
文章分类

全部博文(416)

文章存档

2022年(1)

2021年(1)

2020年(1)

2019年(5)

2018年(7)

2017年(6)

2016年(7)

2015年(11)

2014年(1)

2012年(5)

2011年(7)

2010年(35)

2009年(64)

2008年(48)

2007年(177)

2006年(40)

我的朋友

分类: C/C++

2009-01-20 15:02:27

最近单位要把软件QT化,借此机会也学习学习这个跨平台的UI库,把平时遇到的问题记录下来,以供大家参考

#include
#include
#include
#include
#include
#include
#include
int main(int argc, char **argv)
{
 QApplication a(argc,argv);
 //a.setDefaultCodec(QTextCodec::codecForName("GBK"));
 QWidget window;
 QHBoxLayout box;
 QTextCodec::setCodecForTr(QTextCodec::codecForName("gb18030"));
 QFont font("Simsun",12,QFont::Normal,FALSE);
 a.setFont(font);
 //font.setFamily ("c:\\windows\\fonts\\simhei.ttf");
 
 QPushButton quit(QObject::tr("退出"),0);
 //quit.setFont( QFont( "Simhei", 18, QFont::Bold ) );
 QObject::connect(&quit,SIGNAL(clicked()),&a,SLOT(quit()));
 box.addWidget(&quit);
 window.setLayout(&box);
 window.show();
 return a.exec();
}
阅读(1572) | 评论(0) | 转发(0) |
0

上一篇:freetype2中文显示(2)

下一篇:FTGL demo样例

给主人留下些什么吧!~~