Chinaunix首页 | 论坛 | 博客
  • 博客访问: 606613
  • 博文数量: 138
  • 博客积分: 3067
  • 博客等级: 中校
  • 技术积分: 1565
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 12:44
文章分类

全部博文(138)

文章存档

2016年(5)

2014年(4)

2012年(1)

2011年(2)

2010年(10)

2009年(19)

2008年(97)

我的朋友

分类: C/C++

2008-04-01 11:24:41

编辑UI文件


1. 加入槽:

    slotInput()
    ...
    slotSave()


2. 加入函数:

    specifier="non virtual">init()
    returnType="QListViewItem*">traverse_tree(QListViewItem* pItem, QStringList & qsl)
    ...
    RefreshList()


注:UI文件中 定义 引用参数。

3.加入头文件

    impldecl="in implementation">CUserDefineDlg.ui.h


注:make时,若没有头文件定义, .ui.h文件不会加入到make中。


4.关联槽


   
        leGoodsName
        returnPressed()
        CUserDefineDlg
        slotGoodsNameReturn()
   


注:可使用QAccel


#include <qaccel.h>
static QAccel *a ;
a->connectItem( a->insertItem(Key_Down), this, SLOT(slotKeyDown()) );



5. UI文件中汉字存储为UTF8,可直接以UTF8字体编辑UI文件中的汉字

6. QT中字体转换

#define GB_UTF8(str) (QTextCodec::codecForName("gb2312")->toUnicode(str))
#define UTF8_GB(str) (QTextCodec::codecForName("gb2312")->fromUnicode(str))



阅读(3209) | 评论(0) | 转发(0) |
0

上一篇:QT 项目文件介绍

下一篇:pragma

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