系列文章

下载地址

https://github.com/xxNull-lsk/my_dict

百度网盘 提取码: ihbi

星火应用商店

一、BUG修订

打包后的程序调用系统通知报错

这个问题的表现是启动时报错:

symbol _ZN22QGuiApplicationPrivate28sendApplicationPaletteChangeEbPKc version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference

后来发现是因为PyQt5-sipPyQt5不匹配导致的。

无法输入中文

之前从网上查都说是因为缺少libfcitxplatforminputcontextplugin.so导致的。在我的系统中不是。我发现我Python里面和系统里面安装的QT的版本不一样。即使按照网上的方法复制过来也是无法输入中文的。解决方法其实是安装与系统中Qt版本一致的PyQt5.
查看系统中Qt版本的方法为:

   strings /lib/x86_64-linux-gnu/libQt5Core.so.5| grep " version Qt"

然后,安装对应版本的PyQt5。需要留意的是安装PyQt5最好是使用命令:

pip3 install pyqt5-tools==Version

还有一点就是高版本的pyqt5可能需要升级一下pip3才行,否则会安装失败。报错:

  Downloading https://mirrors.aliyun.com/pypi/packages/8e/a4/d5e4bf99dd50134c88b95e926d7b81aad2473b47fde5e3e4eac2c69a8942/PyQt5-5.15.4.tar.gz (3.3MB)
    100% |████████████████████████████████| 3.3MB 1.5MB/s 
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.7/tokenize.py", line 447, in open
        buffer = _builtin_open(filename, &#039;rb&#039;)
    FileNotFoundError: [Errno 2] No such file or directory: &#039;/tmp/pip-install-l76nh_f8/pyqt5/setup.py&#039;

将pip3升级到最新版就没有这个错误了。

二、界面逻辑BUG

  • 界面文字错误。
  • 剪贴板取词:本来复制3次时触发取词,实际上时4次才会触发。
  • OCR取词:触发逻辑走了剪贴板取词的判断逻辑,导致需要取词4次才会翻译。

三、优化界面

将取词界面加上半透明和圆角。比原来方方正正的更加美观一点。
clipboard-1.png

系列文章