Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2193357
  • 博文数量: 230
  • 博客积分: 9346
  • 博客等级: 中将
  • 技术积分: 3418
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-26 01:58
文章分类

全部博文(230)

文章存档

2015年(30)

2014年(7)

2013年(12)

2012年(2)

2011年(3)

2010年(42)

2009年(9)

2008年(15)

2007年(74)

2006年(36)

分类: LINUX

2011-05-12 00:17:17

根据 google 的结果,有说用 qtconfig 的,有说删除 /usr/lib/kde[34] 的,试过了都不行,说说我的分析和解决办法

首先,发现 qtconfig 调整字体后没有反应,怀疑配置没有正确保存,或存错了位置,于是

root@platinum ~ 
# whereis qtconfig
qtconfig: /usr/bin/qtconfig

找到 qtconfig 的位置,准备用 strace 跟踪一下

root@platinum ~ 
# strace /usr/bin/qtconfig
......
stat("/root/.config/Trolltech.conf", {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
open("/root/.config/Trolltech.conf", O_RDONLY|O_CLOEXEC) = 10
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
fstat(10, {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
close(10)                               = 0
stat("/root/.config/Trolltech.conf", {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
stat("/root/.config/Trolltech.conf", {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
open("/root/.config/Trolltech.conf", O_RDONLY|O_CLOEXEC) = 10
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
fstat(10, {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
fstatfs(10, {f_type="REISERFS_SUPER_MAGIC", f_bsize=4096, f_blocks=120483810, f_bfree=4962728, f_bavail=4962728, f_files=0, f_ffree=0, f_fsid={-159851907, -1096259302}, f_namelen=255, f_frsize=4096}) = 0
fcntl(10, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
stat("/root/.config/Trolltech.conf", {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
fstat(10, {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
fstat(10, {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
read(10, "[Qt%20Plugin%20Cache%204.5.false"..., 59732) = 59732
stat("/root/.config/Trolltech.conf", {st_mode=S_IFREG|0644, st_size=59732, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=405, ...}) = 0
close(10)                               = 0
stat("/etc/qt4/Trolltech.conf", 0x7fffaf4b4b50) = -1 ENOENT (No such file or directory)
stat("/etc/qt4/Trolltech.conf", 0x1c9a128) = -1 ENOENT (No such file or directory)
stat("/root/.kde4/share/config/kdeglobals", {st_mode=S_IFREG|0600, st_size=5898, ...}) = 0
open("/root/.kde4/share/config/kdeglobals", O_RDONLY|O_CLOEXEC) = 10
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
fstat(10, {st_mode=S_IFREG|0600, st_size=5898, ...}) = 0
close(10)                               = 0
stat("/root/.kde4/share/config/kdeglobals", {st_mode=S_IFREG|0600, st_size=5898, ...}) = 0
stat("/root/.kde4/share/config/kdeglobals", {st_mode=S_IFREG|0600, st_size=5898, ...}) = 0
open("/root/.kde4/share/config/kdeglobals", O_RDONLY|O_CLOEXEC) = 10
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
fstat(10, {st_mode=S_IFREG|0600, st_size=5898, ...}) = 0
 
由于内容很多,省去了绝大部分,只保留了关键内容,其中红色信息很重要,找到了 qtconfig 动过的文件
经过分析,把 /root/.config/Trolltech.conf 中 fonts= 是 qtconfig 设置好的 default font
而 /root/.config/Trolltech/Designer.conf 中保存的信息就是我们关心的内容了

font="WenQuanYi Bitmap Song,10,-1,5,50,0,0,0,0,0"
useFont=true                                    

修改之后,运行 QT Designer 依然没有中文菜单,但正文部分的字体好看多了
接着修改 /root/.kde4/share/config/kdeglobals

font="WenQuanYi Bitmap Song,10,-1,5,50,0,0,0,0,0"

搞定,收工

阅读(14364) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~