# 【历史讨论】GoldenDict-ng 基于Qt5.15.2/Qt6.X版本

**URL:** <https://forum.freemdict.com/t/topic/11495>\
**Category:** GoldenDict-ng\
**Tags:** goldendict\
**Created:** [2022 年3 月 14 日 13:17 UTC](https://forum.freemdict.com/t/topic/11495 "2022-03-14T13:17:30Z")\
**Posts on this page:** 20\
**Page:** 47

<div class="post-metadata">

作者： ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
发布日期： [2022 年5 月 8 日 01:41 UTC](https://forum.freemdict.com/t/topic/11495/953 "2022-05-08T01:41:56Z")

</div>

其实我一直有个疑问，看 C++ 源码也许可以解决，但是我不会看。GD 读取 MDX 词头是走它自己缓存吗？也就是 GD 可以很快找到一个词头内容所在的块吗，而不是用算法查找词头信息块？

---

<div class="post-metadata">

作者： ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
发布日期： [2022 年5 月 8 日 02:03 UTC](https://forum.freemdict.com/t/topic/11495/954 "2022-05-08T02:03:08Z")

</div>

gd会对mdx建立自己的索引。记录各个词条在mdd中的位置。  
内部用的Btree

---

<div class="post-metadata">

作者： ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
发布日期： [2022 年5 月 8 日 03:59 UTC](https://forum.freemdict.com/t/topic/11495/955 "2022-05-08T03:59:43Z")

</div>

> [@hua](#):
>
> 不知道 GD 容易做懒加载吗？先加载前十个词典，滑动到倒数第二个词典的时候才加载接下来的十个。

分阶段加载的问题：

一是后面插入的script标签不会主动运行，虽然可以通过人为重新创建script标签解决，但这种方案会导致src外部脚本和内嵌脚本的执行顺序和预期不一致，结果有可能是内嵌脚本先执行，此时外部脚本还没有加载完成，然后内嵌脚本报错。

二是后面加载的script脚本，有很多词典是需要监听`window.onload`，或者 `DOMContentLoaded`之类的事件再执行，但分阶段加载页面的话，这些事件是不会触发的。即使可以手动触发这些事件，也需要先确定前面的脚本已经加载完成，如果使用`addEventListener`的话，还会导致前面加载脚本重复执行。

具体细节问题很多。

---

<div class="post-metadata">

作者： ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
发布日期： [2022 年5 月 8 日 05:30 UTC](https://forum.freemdict.com/t/topic/11495/956 "2022-05-08T05:30:45Z")

</div>

qt内置样式  
`goldendict.exe -style fusion`  
[https://doc.qt.io/qt-5/qstyle.html#setting-a-style](https://doc.qt.io/qt-5/qstyle.html#setting-a-style)

---

<div class="post-metadata">

作者： ![Akira](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@Akira](https://forum.freemdict.com/u/Akira)\
发布日期： [2022 年5 月 8 日 07:47 UTC](https://forum.freemdict.com/t/topic/11495/957 "2022-05-08T07:47:28Z")

</div>

The performance problem that affects me has actually piqued @xiaoyifang interest ✌

OMG, the performance of GD has been improved so much. Now GD takes only 5 seconds to render the entry “run”. Before that, it took almost 14 seconds to render that entry.

Thank you so much!!!

---

<div class="post-metadata">

作者： ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
发布日期： [2022 年5 月 8 日 09:18 UTC](https://forum.freemdict.com/t/topic/11495/958 "2022-05-08T09:18:47Z")

</div>

你用的是qt5的版本，还是qt6的版本，如果用的是qt5的，顺带试下qt6的版本显示是否正常  
我这里两个版本都是正常的，应该还是跟字体设置有关系。

---

<div class="post-metadata">

作者： ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
发布日期： [2022 年5 月 8 日 09:43 UTC](https://forum.freemdict.com/t/topic/11495/959 "2022-05-08T09:43:18Z")

</div>

新增特性：

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/e/1/e19fcc79fc64ea6db7a2d75394257885ccd97312.png)  
新增了一个词典备用字体设置的地方。

不过貌似需要先把全宋体的多个文件合并成一个（还是说其中哪个文件是包含所有全宋字体？）。

---

<div class="post-metadata">

作者： ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
发布日期： [2022 年5 月 8 日 09:47 UTC](https://forum.freemdict.com/t/topic/11495/960 "2022-05-08T09:47:08Z")

</div>

好的，一会来看看。

---

<div class="post-metadata">

作者： ![bwjhr](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bwjhr](https://forum.freemdict.com/u/bwjhr)\
发布日期： [2022 年5 月 8 日 09:57 UTC](https://forum.freemdict.com/t/topic/11495/961 "2022-05-08T09:57:08Z")

</div>

以后能增加一个词典重命名的功能吗?有的词典名称比较长,在GD中占地方多或显示不全,或者一个词典有多个版本,如果能重命名比较好区别

---

<div class="post-metadata">

作者： ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
发布日期： [2022 年5 月 8 日 10:56 UTC](https://forum.freemdict.com/t/topic/11495/962 "2022-05-08T10:56:56Z")

</div>

小众功能，后续看下吧，如果有简单实现，就处理下。

---

<div class="post-metadata">

作者： ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
发布日期： [2022 年5 月 8 日 11:50 UTC](https://forum.freemdict.com/t/topic/11495/963 "2022-05-08T11:50:12Z")

</div>

用的qt6.3，今天的版本，还是不行。设置了词典字体也没效果。

 ![gd](https://forumcdn.freemdict.com/uploads/default/original/3X/4/0/409d4c3155413cb9023bb1e5ef87b43b9c8cd80e.png)

这个事不对啊，css已经指定显示字体，我不但安装了全宋体，还在词典文件夹内放了字体文件，但这个 GD 似乎不愿调用？  
难道是因为我用的便携模式？

---

<div class="post-metadata">

作者： ![shuitu](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/54ee81/32.png) [@shuitu](https://forum.freemdict.com/u/shuitu)\
发布日期： [2022 年5 月 8 日 11:52 UTC](https://forum.freemdict.com/t/topic/11495/964 "2022-05-08T11:52:07Z")

</div>

趁机呼吁一下：现在mdx工具书制作是八仙过海，各显神通，但存在不规范的问题。如果大家能像超星图书那样有个基本的命名方式，比如像这样：书名+作者+出版社+出版年份+版本号（或制作时间），这样就更好了。我是mdx小白，斗胆提出这种建议，有点不知天高地厚，望各路神仙谅解。

---

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2022 年5 月 8 日 11:55 UTC](https://forum.freemdict.com/t/topic/11495/965 "2022-05-08T11:55:22Z")

</div>

GD软件内置的繁简转换是否可以加强一下？好像内置的是OpenCC，但是某些词无法正确转换：比如查“丑宝”，GD无法转换成“丑寳”，猜测可能错误转成了“醜寳”，“丑”字即是本字，又是“醜”的简体字，也就导致仅收录该词繁体字头“丑寳”的词典查不到，比如“本草纲目”词典、汉语大词典、中文大辞典等。  
试了官方OpenCC网页版也是如此：

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/3/d/3d4d191bea3ee2552c581985d7b1625b1ea6d21d.png)

TextPro则可以正确转换：  
 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/c/4/c4511de97fe10f477229e64cd25f4a2b02fe981c.png)

看到隔壁一篇帖子说如果可以支持自定义扩充转换表，或是换上TextPro的简繁转换模块就好了（这个改动比较大，估计不好弄。。）

[GD使用的中文繁简模块有待增强 - GoldenDict - 掌上百科 - PDAWIKI - Powered by Discuz!](https://www.pdawiki.com/forum/forum.php?mod=viewthread&tid=40983&highlight=%E7%B9%81%E7%AE%80)

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/4/1/41545dfcba0846bfca9ae80dee3d7f4b8dcabf75.png)

---

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2022 年5 月 8 日 11:56 UTC](https://forum.freemdict.com/t/topic/11495/966 "2022-05-08T11:56:28Z")

</div>

奇怪，我用的也是便携模式，可以正常显示：

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/8/4/8406588aece3fee74ec12286df21529c17a6eefa.png)

---

<div class="post-metadata">

作者： ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
发布日期： [2022 年5 月 8 日 12:04 UTC](https://forum.freemdict.com/t/topic/11495/967 "2022-05-08T12:04:02Z")

</div>

是直接就能显示，还是做了什么设置？

---

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2022 年5 月 8 日 12:06 UTC](https://forum.freemdict.com/t/topic/11495/968 "2022-05-08T12:06:27Z")

</div>

安装了字体，打开GD直接就能显示。你装完全宋体，有没有把注册表的文件导入?

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/6/a/6acf1da297596f0f33cab1a5bbb6cb6fe560d360.png)

---

<div class="post-metadata">

作者： ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
发布日期： [2022 年5 月 8 日 12:11 UTC](https://forum.freemdict.com/t/topic/11495/969 "2022-05-08T12:11:50Z")

</div>

肯定导入了啊，499可以显示，上面楼有贴图。我现在不记得以前有没有进行过设置。

---

<div class="post-metadata">

作者： ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
发布日期： [2022 年5 月 8 日 12:12 UTC](https://forum.freemdict.com/t/topic/11495/970 "2022-05-08T12:12:44Z")

</div>

这个是opencc问题。如果确认丑宝有错。可以反馈到opencc。github

---

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2022 年5 月 8 日 12:14 UTC](https://forum.freemdict.com/t/topic/11495/971 "2022-05-08T12:14:37Z")

</div>

OpenCC是可以自定义扩充转换表的，但是Goldendict还不行。这个有希望实现吗？

---

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2022 年5 月 8 日 12:17 UTC](https://forum.freemdict.com/t/topic/11495/972 "2022-05-08T12:17:54Z")

</div>

是不是配置哪里变了？我是每次更新GD版本，把content和portable以外的文件/文件夹全部删除，然后换上新的。

[上一页](https://forum.freemdict.com/t/topic/11495.md?page=46)

[下一页](https://forum.freemdict.com/t/topic/11495.md?page=48)
