[kde-china] 自己写的一个显示 CPU 频率的 plasmoid

Wang Hoi zealot.hoi在gmail.com
星期二 三月 17 12:14:42 CET 2009


Plasma::Theme里面有函数得到默认字体。

也可以用QApplication::font()

On 3/17/09, Grissiom <chaos.proton在gmail.com> wrote:
> 2009/3/17 wd <wd在wdicc.com>
>
>> 我之前也写了一个。。汗。。
>> http://wdicc.com/writing-a-kde-plasma-applet/
>>
>>
> 拜读了您的代码,收益菲浅啊~ 我怎么就没想到直接打开 sysfs 的文件呢?还费了半天时间查 subprocess 的文档,窘…… 也没想到
> plasmascript.Applet 里内置 timer,回头试试去~
>
> 对了,看您的代码里注释了一行
> painter.setFont(QFont('Consolas',11)),我也曾经想在脚本里设置字体的,但是一直不成功。看 ruby-cpufreq
> 里有一行:
>
> @plainFont = KDE::GlobalSettings.generalFont
>
> 貌似得到了系统的默认字体。但是在 PyKDE4 里一直没能找到对应的函数……
>
> --
> Cheers,
> Grissiom
>


关于邮件列表 kde-china 的更多信息